:root {
  --brand-orange: #ec7700;
  --brand-orange-light: #ffd4a8;
  --brand-orange-mid: #f4a564;
  --brand-green-deep: #1d3711;
  --brand-green-mid: #3a6b22;
  --brand-green: #7cb854;
  --brand-green-light: #a8d490;
  --neutral-gray: #e5e5e5;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #8a8a8a;
  --border-soft: #d8d8d8;
  --state-stroke: #ffffff;
  /* Same as equal-chances grey: land with no outlook zone reads as equal
     chances, so neutral areas are uniform (no lighter base-land patches). */
  --base-state-fill: #e5e5e5;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 28px 20px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}

.header h1 {
  margin: 0 0 5px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 720px;
}

.meta-line {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.meta-line strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toggle-group {
  display: inline-flex;
  background: #f0efec;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.toggle {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 160ms ease, color 160ms ease;
}

.toggle:hover {
  color: var(--text-primary);
}

.toggle.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.map-wrap {
  position: relative;
  width: 100%;
}

#map {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 600;
  background: transparent;
}

/* NOAA contour polygons. No internal stroke so adjacent probability
   bands flow into one another; the white state grid sits on top. */
.overlay-poly {
  stroke: none;
  transition: opacity 200ms ease;
}

.base-state {
  fill: var(--base-state-fill);
  stroke: #c9c9c5;
  stroke-width: 0.75;
}

.state-outline {
  fill: none;
  stroke: #ffffff;
  stroke-width: 0.75;
  pointer-events: none;
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 10px 2px 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.legend-swatch {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.legend-label {
  font-family: 'Open Sans', sans-serif;
  white-space: nowrap;
}

.attribution {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--neutral-gray);
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .container { margin: 0; border-radius: 0; padding: 18px 16px; }
  .header h1 { font-size: 20px; }
  .controls { flex-direction: column; align-items: flex-start; }
  .legend { gap: 10px; }
}
