* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family:
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  background: #0a1628;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}
header {
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #b5e829;
}
header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
header h1 span {
  color: #b5e829;
}
.subtitle {
  font-size: 14px;
  color: #8899aa;
  margin-top: 2px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.logo-icon {
  width: 36px;
  height: 36px;
}
.controls {
  display: flex;
  gap: 8px;
  padding: 16px 40px;
  flex-wrap: wrap;
  align-items: center;
}
.controls label {
  font-size: 13px;
  color: #8899aa;
  margin-right: 4px;
}
.btn {
  padding: 8px 18px;
  border: 1px solid #2a3a4e;
  background: #12213a;
  color: #ccd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.btn:hover {
  background: #1a2d4a;
  border-color: #3a5a7e;
}
.btn.active {
  background: #b5e829;
  color: #0a1628;
  border-color: #b5e829;
  font-weight: 600;
}
.map-container {
  display: flex;
  align-items: flex-start;
  padding: 10px 20px 20px;
  gap: 20px;
  flex-wrap: wrap;
}
.map-wrap {
  flex: 1;
  min-width: 650px;
}
.map-wrap svg {
  width: 100%;
  height: auto;
}
.state-path {
  stroke: #0a1628;
  stroke-width: 1;
  cursor: pointer;
  transition:
    opacity 0.15s,
    filter 0.15s;
}
.state-path:hover {
  opacity: 0.82;
  filter: brightness(1.25);
  stroke: #fff;
  stroke-width: 1.8;
}
.state-label {
  pointer-events: none;
  fill: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: system-ui;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 2.5px;
}
.state-label.small {
  font-size: 9px;
}
.legend {
  width: 300px;
  flex-shrink: 0;
  background: #101f35;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #1e3050;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.legend h3 {
  font-size: 14px;
  margin-bottom: 14px;
  color: #b5e829;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.legend-item:hover {
  background: #1a2d4a;
}
.legend-item.highlight {
  background: #1e3558;
}
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.legend-name {
  font-size: 13px;
  font-weight: 600;
}
.legend-detail {
  font-size: 11px;
  color: #6688aa;
  margin-top: 1px;
}
.legend-states {
  font-size: 11px;
  color: #556;
  margin-top: 2px;
}

/* ── Tooltip (hover) ── */
#tooltip {
  position: fixed;
  pointer-events: none;
  background: #12213aee;
  border: 1px solid #b5e829;
  border-radius: 10px;
  padding: 16px 20px;
  z-index: 100;
  display: none;
  min-width: 290px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}
.tt-state {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}
.tt-section {
  margin-bottom: 10px;
}
.tt-section:last-child {
  margin-bottom: 0;
}
.tt-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #b5e829;
  margin-bottom: 3px;
}
.tt-name {
  font-size: 15px;
  font-weight: 600;
}
.tt-contact {
  font-size: 12px;
  color: #8899aa;
  margin-top: 1px;
}
.tt-region {
  font-size: 11px;
  color: #b5e829;
  font-style: italic;
}
.tt-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #8899aa;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.tt-close:hover {
  color: #fff;
}

/* ── Detail pane (slide-in from right) ── */
#detailPane {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100%;
  background: #101f35;
  border-left: 2px solid #b5e829;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
}
#detailPane.open {
  transform: translateX(0);
}
.dp-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #1e3050;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: #101f35;
  z-index: 1;
}
.dp-state {
  font-size: 22px;
  font-weight: 700;
}
.dp-close {
  background: none;
  border: none;
  color: #8899aa;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 0 4px 12px;
}
.dp-close:hover {
  color: #fff;
}
.dp-body {
  padding: 8px 24px 24px;
  flex: 1;
}
.dp-role-section {
  margin-bottom: 20px;
}
.dp-role-section:last-child {
  margin-bottom: 0;
}
.dp-role-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #b5e829;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1e3050;
}
.dp-person {
  margin-bottom: 14px;
}
.dp-person:last-child {
  margin-bottom: 0;
}
.dp-region {
  font-size: 11px;
  color: #b5e829;
  font-style: italic;
  margin-bottom: 2px;
}
.dp-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.dp-contact {
  font-size: 13px;
  color: #8899aa;
  margin-top: 3px;
}
.dp-contact a {
  color: #8899aa;
  text-decoration: none;
}
.dp-contact a:hover {
  color: #b5e829;
  text-decoration: underline;
}
.dp-territories {
  margin-top: 8px;
}
.dp-territories-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #556;
  margin-bottom: 3px;
}
.dp-territories-list {
  font-size: 12px;
  color: #6688aa;
  line-height: 1.5;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  display: inline-block;
}
.search-wrap input {
  padding: 8px 14px 8px 32px;
  border: 1px solid #2a3a4e;
  background: #12213a;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  width: 220px;
  outline: none;
}
.search-wrap input:focus {
  border-color: #b5e829;
}
.search-wrap .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #6688aa;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  header {
    padding: 14px 16px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  header h1 {
    font-size: 20px;
  }
  .subtitle {
    font-size: 12px;
  }
  .logo {
    align-self: flex-end;
    margin-top: -36px;
  }
  .logo img {
    height: 30px !important;
  }
  .controls {
    padding: 10px 16px;
    gap: 6px;
  }
  .controls label {
    display: none;
  }
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  .search-wrap {
    width: 100%;
    order: -1;
  }
  .search-wrap input {
    width: 100%;
  }
  .map-container {
    padding: 8px 10px 16px;
    gap: 12px;
  }
  .map-wrap {
    min-width: 100%;
  }
  .legend {
    max-width: 100%;
    min-width: 100%;
    max-height: none;
  }
  #tooltip {
    display: none !important;
  }
  .tt-state {
    font-size: 17px;
  }
  #detailPane {
    width: 100%;
    top: auto;
    bottom: 0;
    height: auto;
    max-height: 80vh;
    border-left: none;
    border-top: 2px solid #b5e829;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  #detailPane.open {
    transform: translateY(0);
  }
}
@media (max-width: 1000px) and (min-width: 769px) {
  .map-wrap {
    min-width: 100%;
  }
  .legend {
    max-width: 100%;
    min-width: 100%;
  }
  header {
    padding: 16px 20px;
  }
  .controls {
    padding: 12px 20px;
  }
}
