:root {
  --bg-left: #f68bc4;
  --bg-middle: #cf9cff;
  --bg-right: #63a7ff;
  --bg-glow: rgba(255, 255, 255, 0.22);
  --bg-pink: rgba(255, 122, 182, 0.34);
  --panel: #ffffff;
  --panel-soft: #f4f8fe;
  --text: #123253;
  --muted: #67819c;
  --stroke: #d4e3f4;
  --accent: #0b5ed7;
  --accent-soft: #dbeafe;
  --shadow: 0 26px 60px rgba(4, 35, 79, 0.16);
  --radius: 30px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at 22% 72%, var(--bg-pink), transparent 30%),
    radial-gradient(circle at 82% 16%, var(--bg-glow), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(90deg, var(--bg-left) 0%, var(--bg-middle) 42%, var(--bg-right) 100%);
}

.page-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
}

.hero {
  min-height: 36vh;
  display: grid;
  place-items: center;
  padding: 52px 40px;
  background:
    linear-gradient(180deg, rgba(11, 94, 215, 0.05), rgba(11, 94, 215, 0.01)),
    var(--panel);
}

.hero-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}

.lang-switch {
  display: flex;
  gap: 8px;
  justify-self: end;
  align-self: start;
}

.lang-btn {
  border: 1px solid #c6d8ef;
  background: #ffffff;
  color: #31557d;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.lang-btn.is-active {
  background: #0b5ed7;
  color: #ffffff;
  border-color: #0b5ed7;
}

.hero-copy {
  text-align: left;
  flex: 1;
}

.hero h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #0f2a49;
}

.hero p {
  margin: 22px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.dashboard {
  padding: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.sidebar,
.map-panel {
  background: var(--panel-soft);
  border: 1px solid var(--stroke);
  border-radius: 24px;
}

.sidebar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.control-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #21496f;
}

select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #bdd3ea;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

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

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #d7e6f5;
}

.stat-card span {
  display: block;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0e3159;
}

.legend-block,
.note-block {
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #d7e6f5;
}

.legend-block h3,
.note-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.gradient-bar {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d8efff 0%, #74b6ff 45%, #0b4cb4 100%);
  margin-bottom: 10px;
}

.legend-values {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.note-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.map-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 720px;
  position: relative;
}

.map-wrap {
  position: relative;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  min-height: 620px;
}

#mapSvg {
  width: 100%;
  height: 100%;
  display: block;
}

.section-shape {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.4;
  transition: fill 180ms ease, opacity 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.section-shape:hover,
.section-shape.is-active {
  stroke: #0d2b50;
  stroke-width: 2.2;
  opacity: 1;
}

.map-tooltip {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  background: rgba(11, 31, 56, 0.96);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  min-width: 200px;
  box-shadow: 0 16px 34px rgba(4, 24, 49, 0.28);
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 2;
}

.map-tooltip strong,
.map-tooltip span {
  display: block;
}

.map-tooltip strong {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.map-tooltip span {
  font-size: 0.88rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.84);
}

.note-block h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: #103966;
}

.note-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

  .map-panel {
    min-height: 640px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 10px;
  }

  .hero,
  .dashboard,
  .definitions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .lang-switch {
    justify-content: flex-start;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .lang-switch {
    justify-self: start;
  }

  .stats {
    grid-template-columns: 1fr;
  }
  .map-wrap {
    min-height: 460px;
  }

}
