* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  background: #f5f3f8;
}

.site-header {
  background: #3b2063;
  color: white;
  border-bottom: 4px solid #d8b44c;
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.site-header h1 {
  margin: 0 0 6px 0;
  font-size: 26px;
  line-height: 1.2;
}

.site-header p {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  opacity: 0.95;
}

.site-link {
  display: inline-block;
  color: white;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.site-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.page-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  min-height: calc(100vh - 86px);
}

.lookup-panel {
  background: #ffffff;
  border-right: 1px solid #ddd;
  padding: 18px;
  overflow-y: auto;
  max-height: calc(100vh - 86px);
}

.lookup-intro h2 {
  margin: 0 0 6px 0;
  font-size: 22px;
  color: #3b2063;
}

.lookup-intro p {
  margin: 0 0 14px 0;
  font-size: 14px;
  line-height: 1.4;
  color: #555;
}

.address-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#addressInput {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  font-size: 15px;
  border: 1px solid #bbb;
  border-radius: 6px;
}

#addressInput:focus {
  outline: 2px solid #d8b4ff;
  border-color: #3b2063;
}

#lookupButton {
  padding: 11px 16px;
  font-size: 15px;
  font-weight: bold;
  background: #3b2063;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#lookupButton:hover {
  background: #2d174e;
}

.lookup-note {
  font-size: 12px;
  color: #666;
  margin-bottom: 14px;
}

.lookup-results {
  border-top: 1px solid #eee;
  padding-top: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.empty-state {
  padding: 14px;
  background: #f7f4fb;
  border: 1px dashed #cbb8e6;
  border-radius: 8px;
  color: #555;
}

.district-summary {
  padding: 12px;
  background: #f7f4fb;
  border: 1px solid #e4d9f3;
  border-radius: 8px;
  margin-bottom: 16px;
}

.district-summary h3 {
  margin: 0 0 8px 0;
  color: #3b2063;
  font-size: 17px;
}

.district-summary p {
  margin: 4px 0;
}

.candidate-office-group {
  margin-top: 18px;
}

.candidate-office-group h3 {
  margin: 0 0 8px 0;
  padding-bottom: 5px;
  border-bottom: 2px solid #d8b44c;
  color: #3b2063;
  font-size: 16px;
}

.candidate-card {
  padding: 12px;
  margin: 10px 0;
  background: white;
  border: 1px solid #ddd;
  border-left: 5px solid #3b2063;
  border-radius: 8px;
}

.candidate-card strong {
  font-size: 15px;
  color: #222;
}

.candidate-card a {
  color: #3b2063;
  font-weight: bold;
}

.candidate-card a:hover {
  color: #1f0f38;
}

.map-section {
  min-width: 0;
}

#map {
  width: 100%;
  height: calc(100vh - 86px);
}

.district-popup {
  font-size: 14px;
  line-height: 1.4;
}

.district-popup strong {
  color: #3b2063;
}

.leaflet-control-layers {
  border-radius: 8px;
  font-size: 14px;
}

.leaflet-popup-content {
  min-width: 190px;
}

/* Mobile layout */
@media (max-width: 850px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-layout {
    display: block;
  }

  .lookup-panel {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  #map {
    height: 70vh;
  }

  .address-row {
    flex-direction: column;
  }

  #lookupButton {
    width: 100%;
  }
}