body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, -webkit-system-font, sans-serif;
  background: #020617;
  color: #e5e7eb;
}

header {
  padding: 16px 24px;
  background: #020617;
  border-bottom: 1px solid #111827;
}

.header-main h1 {
  margin: 0;
  font-size: 24px;
}

.header-main p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

main {
  padding: 12px 24px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto 1fr;
  grid-gap: 16px;
}

#controls {
  grid-column: 1 / 2;
}

#map-container {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

#map {
  width: 100%;
  height: 620px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

#right-column {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#route-risk, #hotspot-details {
  background: #020617;
  padding: 12px 14px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #1f2937;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.control-item label {
  font-size: 12px;
  color: #9ca3af;
}

select, button, input[type="text"] {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  outline: none;
  font-size: 13px;
}

select, input[type="text"] {
  background: #020617;
  color: #e5e7eb;
}

button {
  cursor: pointer;
  background: #2563eb;
  color: white;
  font-weight: 500;
  border: none;
  padding: 8px 14px;
}

button:hover {
  background: #1d4ed8;
}

.legend {
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.low {
  background: #22c55e;
}

.legend-dot.medium {
  background: #facc15;
}

.legend-dot.high {
  background: #f97316;
}

.legend-note {
  margin-left: 2px;
}

.route-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

.route-form input {
  padding: 6px 8px;
}

#routeResult {
  margin-top: 4px;
  font-weight: 500;
}

.note {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
}

#hotspotOutput {
  background: #020617;
  padding: 8px;
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 12px;
  border: 1px solid #1f2937;
}

footer {
  padding: 10px 24px 16px;
  font-size: 11px;
  color: #6b7280;
  border-top: 1px solid #111827;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  #map-container, #controls, #right-column {
    grid-column: 1 / 2;
    grid-row: auto;
  }
  #map {
    height: 420px;
  }
}
