:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #647067;
  --line: #d8dfd9;
  --panel: #f8faf7;
  --paper: #ffffff;
  --accent: #176b5c;
  --accent-2: #b83f3f;
  --water: #eaf3f4;
  --map-bg: #f4f7f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

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

.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 20px;
  overflow: auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 22px;
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  margin: 20px 0 10px;
  font-size: 13px;
  color: #34433a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-block {
  display: grid;
  gap: 14px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.mode-button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  cursor: pointer;
}

.mode-button:last-child {
  border-right: 0;
}

.mode-button.active {
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 0;
}

.stats > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-value {
  display: block;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.stat-label {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feature-list,
.group-list {
  display: grid;
  gap: 8px;
}

.feature-item,
.group-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.feature-item {
  cursor: pointer;
}

.feature-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 107, 92, 0.12);
}

.swatch {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.item-name {
  display: block;
  font-weight: 700;
}

.item-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.map-wrap {
  position: relative;
  min-height: 100vh;
  background: #1e2721;
  overflow: hidden;
}

#map {
  display: block;
  width: 100%;
  height: 100vh;
}

.toolbar {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}

.toolbar button {
  min-width: 40px;
  min-height: 36px;
  border: 1px solid rgba(23, 33, 27, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.map-tooltip {
  border: 1px solid rgba(23, 33, 27, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font-size: 13px;
}

.map-tooltip strong {
  display: block;
  margin-bottom: 4px;
}

.map-tooltip span {
  display: block;
  color: var(--muted);
}

.tehsil-label {
  width: max-content !important;
  height: auto !important;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  background: rgba(18, 30, 23, 0.64);
  color: #fff;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.old-labels {
  background: rgba(126, 50, 44, 0.68);
}

.source-note {
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hidden {
  display: none;
}

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

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

  #map {
    height: 55vh;
  }

  .map-wrap {
    min-height: 55vh;
  }
}
