:root {
  --ink: #102c59;
  --ink-soft: #56698a;
  --surface: #f7f2ea;
  --panel: #ffffff;
  --line: rgba(16, 44, 89, 0.12);
  --map-fill: #b9c1ea;
  --map-hover: #7d8fd4;
  --accent: #a63b32;
  --accent-soft: #f7e7e2;
  --green: #0f5132;
  --sand: #f7f2ea;
  --navy: #0d2750;
  --drawer: #20386e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--ink);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(247, 242, 234, 0.94), rgba(247, 242, 234, 0.94)),
    url("./assets/orm-pattern.svg");
}

.is-hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 84px 220px minmax(0, 1fr);
}

.theme-rail {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
}

.rail-brand,
.theme {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
}

.rail-brand img {
  width: 48px;
  height: 48px;
  display: block;
}

.theme {
  background: rgba(255, 255, 255, 0.12);
  color: #dbe4ff;
  font-size: 20px;
  border-radius: 14px;
}

.theme.is-active {
  background: #fff;
  color: var(--ink);
}

.theme-drawer {
  background: linear-gradient(180deg, var(--drawer), #192f63);
  color: #fff;
  padding: 108px 18px 24px;
  border-right: 1px solid rgba(16, 44, 89, 0.12);
}

.theme-drawer p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
}

.theme-drawer h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.theme-drawer nav {
  display: grid;
  gap: 10px;
}

.theme-drawer a {
  color: #fff;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  line-height: 1.25;
}

.theme-drawer a.is-active {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.drawer-note {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.5;
}

.content {
  padding: 36px 42px 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-lockup img {
  width: 46px;
  height: 46px;
}

.brand-lockup p {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
}

.brand-lockup span {
  color: var(--ink-soft);
  font-size: 13px;
}

.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.summary-strip article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
}

.summary-strip span {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-bottom: 7px;
}

.summary-strip strong {
  font-size: 22px;
}

#map {
  height: min(68vh, 700px);
  min-height: 520px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.8), transparent 30%),
    linear-gradient(145deg, #fefefe, #eef1fb);
}

.leaflet-container {
  background: transparent;
  font: inherit;
}

.leaflet-interactive:focus {
  outline: none;
}

.region-label {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.years {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.years button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
}

.years .is-active {
  background: var(--ink);
  color: #fff;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.download-panel,
.detail-panel,
.legend-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(16, 44, 89, 0.08);
}

.download-actions {
  display: flex;
  gap: 12px;
  margin: 14px 0 12px;
}

.download-button {
  flex: 1;
  border: 0;
  min-height: 56px;
  border-radius: 18px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.download-button.pdf {
  background: var(--accent);
}

.download-button.excel {
  background: var(--green);
}

.download-panel small {
  display: block;
  color: var(--ink-soft);
  line-height: 1.45;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
}

.detail-panel h2,
.legend-panel h2 {
  margin: 0 0 20px;
  font-size: 22px;
}

.metrics {
  margin: 0;
  display: grid;
  gap: 12px;
}

.metrics div {
  background: #faf7f6;
  border-radius: 18px;
  padding: 14px 16px;
}

.metrics dt {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}

.metrics dd {
  margin: 0;
}

.legend-block + .legend-block {
  margin-top: 18px;
}

.legend-label {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-bottom: 8px;
}

.legend-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.legend-block li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
}

.legend-block i {
  display: inline-block;
  width: 28px;
  height: 18px;
  border-radius: 6px;
  background: #a9d2ef;
}

.legend-block li:nth-child(2) i {
  background: #7daee0;
}

.legend-block li:nth-child(3) i {
  background: #567fc4;
}

.legend-block li:nth-child(4) i {
  background: #213b7c;
}

.bubble-legend i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.bubble-legend li:nth-child(2) i {
  width: 24px;
  height: 24px;
}

.bubble-legend li:nth-child(3) i {
  width: 30px;
  height: 30px;
}

.legend-note {
  margin: 18px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.subdivisions,
.sources {
  margin-top: 22px;
}

.subdivisions h3,
.sources h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.subdivisions ul,
.sources ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.subdivisions li + li,
.sources li + li {
  margin-top: 6px;
}

.sources a {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .theme-drawer {
    grid-column: 2;
    padding: 18px 24px;
  }

  .content {
    grid-column: 2;
  }
}

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

  .side-stack {
    order: -1;
  }
}

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

  .theme-rail {
    min-height: 72px;
    flex-direction: row;
    justify-content: center;
    border-right: 0;
  }

  .theme-drawer,
  .content {
    grid-column: auto;
  }

  .content {
    padding: 24px 18px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  #map {
    min-height: 440px;
  }
}
