:root {
  --bg: #f7f7f4;
  --ink: #1d1f21;
  --muted: #686d72;
  --line: #d8d8d2;
  --panel: #ffffff;
  --teal: #123c45;
  --teal-soft: #396168;
  --CON: #1f78d1;
  --LAB: #d72f3f;
  --LD: #f5b642;
  --GRN: #32a852;
  --REF: #11a5a5;
  --MUSLIM_IND: #7b4cc2;
  --IND: #8c8f93;
  --NAT_IND: #5c7f39;
  --OTHER: #b2a188;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

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

.map-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #dce9ef;
}

#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#map:active { cursor: grabbing; }

.panel {
  border-left: 1px solid var(--line);
  background: var(--teal);
  padding: 24px;
  overflow-y: auto;
  max-height: 100vh;
  color: white;
  position: relative;
  display: flex;
  flex-direction: column;
}

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

.panel .eyebrow,
.panel h2 {
  color: rgba(255,255,255,.68);
}

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

.subtitle {
  margin: 6px 0 20px;
  color: rgba(255,255,255,.76);
  font-size: 14px;
  line-height: 1.3;
}

h2 {
  margin: 22px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .07em;
}

.search-row input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 6px;
  padding: 11px 12px;
  background: var(--teal-soft);
  color: #fff;
}

.search-row input::placeholder { color: rgba(255,255,255,.66); }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 6px;
  overflow: hidden;
}

.segmented button,
.zoom-controls button {
  border: 0;
  background: var(--teal-soft);
  color: #fff;
  min-height: 38px;
  cursor: pointer;
}

.segmented button + button { border-left: 1px solid rgba(255,255,255,.22); }
.segmented button:nth-child(3) { border-left: 0; border-top: 1px solid rgba(255,255,255,.22); }
.segmented button:nth-child(4) { border-top: 1px solid rgba(255,255,255,.22); }
.segmented button.active { background: #f7f7f4; color: var(--teal); }

.segmented.two button:nth-child(2) { border-top: 0; }

.forecast-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: block;
  padding: 5px 10px 6px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 0;
  background: rgba(18, 60, 69, .93);
  box-shadow: 0 12px 30px rgba(20, 26, 32, .12);
  backdrop-filter: blur(10px);
  pointer-events: none;
  color: white;
}

.panel-credit {
  align-self: flex-end;
  margin-top: auto;
  padding-top: 18px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.panel-credit:hover { color: #fff; }

.forecast-overlay p {
  margin: 0 0 4px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.forecast-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.forecast-chip {
  min-width: 0;
  border-left: 3px solid;
  padding-left: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 1px;
}

.forecast-chip b {
  font-size: 12px;
}

.forecast-chip strong {
  justify-self: end;
  font-size: 18px;
  line-height: 1;
}

.forecast-chip span,
.forecast-chip em {
  grid-column: 1 / -1;
  color: rgba(255,255,255,.66);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.details {
  padding: 15px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: var(--teal-soft);
  font-size: 14px;
  box-shadow: 0 10px 28px rgba(20, 26, 32, .07);
  color: #fff;
}

.muted { color: rgba(255,255,255,.68); }

.details h3 {
  margin: 0 0 2px;
  font-size: 18px;
}

.details p { margin: 5px 0; }

.mini-title {
  margin: 14px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.winner-dots {
  margin: 10px 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.winner-dots span {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.winner-dots i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.2);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}

.share-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.share-bar span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 3px;
}

.share-bar b {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-bar em {
  color: rgba(255,255,255,.72);
  font-style: normal;
  font-size: 12px;
  flex: 0 0 auto;
}

.swing {
  font-size: 12px;
  font-weight: 800;
}

.positive { color: #70e29b !important; }
.negative { color: #ff7b7b !important; }

.control-changes {
  display: grid;
  gap: 8px;
}

.control-row span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 3px;
}

.control-row b,
.control-row em {
  font-size: 12px;
}

.control-row em {
  font-style: normal;
  font-weight: 800;
}

.control-row i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  overflow: hidden;
}

.control-row u {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.prob-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: var(--teal-soft);
  color: #fff;
  box-shadow: 0 10px 28px rgba(20, 26, 32, .07);
}

.prob-card h4 {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pie {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}

.pie.big {
  width: 190px;
  height: 190px;
  margin: 0 auto;
}

.pie span {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0,0,0,.75);
}

.share-bar i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
}

.share-bar u {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(29, 31, 33, .92);
  color: white;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  max-width: 240px;
  transform: translate(12px, 12px);
}

.zoom-controls {
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  gap: 6px;
}

.zoom-controls button {
  width: 38px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  font-weight: 800;
}

@media (max-width: 850px) {
  .app { grid-template-columns: 1fr; }
  .map-shell { min-height: 62vh; }
  .forecast-overlay {
    left: 0;
    right: 0;
  }
  .forecast-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
  }
}
