:root {
  --ink: #111820;
  --deep: #061018;
  --panel: rgba(7, 16, 24, 0.94);
  --line: rgba(255, 255, 255, 0.14);
  --green: #9cd483;
  --muted: rgba(255, 255, 255, 0.72);
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--deep);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

.demo-shell {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  min-height: 100svh;
  align-items: stretch;
}

.demo-panel {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 26px;
  overflow: visible;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(110, 173, 85, 0.12), rgba(15, 111, 171, 0.1)),
    var(--panel);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

h2 {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

p {
  color: var(--muted);
}

.control-group,
.chart-card,
.legend,
.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.control-group,
.chart-card,
.legend {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.chart-card {
  padding-inline: 12px;
}

.year-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.year-buttons button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  cursor: pointer;
  font-weight: 850;
}

.year-buttons button[aria-pressed="true"] {
  border-color: rgba(156, 212, 131, 0.7);
  background: linear-gradient(180deg, #86bf67, #5e9f46);
}

.slider-control span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.slider-control em {
  color: var(--green);
  font-style: normal;
  font-weight: 850;
}

.slider-control input {
  width: 100%;
  accent-color: #6ead55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metrics div {
  padding: 14px;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  color: var(--green);
  font-size: 1.28rem;
  line-height: 1.05;
}

.metrics span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.legend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-axis {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.5;
}

.chart-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-legend-rule {
  stroke: rgba(255, 255, 255, 0.11);
  stroke-width: 1;
}

.chart-label {
  fill: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  font-weight: 800;
}

.chart-year-label {
  font-size: 18px;
}

.demo-note {
  font-size: 0.82rem;
}

.map-wrap,
#map {
  min-height: 100%;
}

.leaflet-container {
  background: #0f1a20;
  font: inherit;
}

.map-message {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 32px;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.leaflet-control-attribution {
  font-size: 10px;
}

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

  .demo-panel {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-wrap,
  #map {
    min-height: 68svh;
  }
}
