:root {
  --bg: #0f1410;
  --bg-elevated: #1a221c;
  --bg-card: #1e2a22;
  --border: #2d3d32;
  --text: #e8f0ea;
  --text-muted: #9aaf9e;
  --accent: #3d9b5f;
  --accent-hover: #4db872;
  --accent-dim: #2a6b42;
  --highlight: #6fd992;
  --coming: #3a4540;
  --warn: #c9a227;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--highlight); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15,20,16,.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .02em;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #1e5c38);
  display: grid; place-items: center;
  font-size: 1.1rem;
}
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--text-muted); font-size: .95rem; }
.nav-links a:hover { color: var(--text); }

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  text-align: center;
}
.hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 750;
}
.hero p {
  margin: 0 auto 1.25rem;
  max-width: 42rem;
  color: var(--text-muted);
}
.legend {
  display: inline-flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: .85rem;
  color: var(--text-muted);
}
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.swatch {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.15);
}
.swatch.active { background: var(--accent); }
.swatch.soon { background: var(--coming); }

.map-wrap {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1rem 2rem;
  position: relative;
}
.map-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem;
  box-shadow: var(--shadow);
}
#us-map {
  width: 100%;
  height: auto;
  display: block;
}
.state-path {
  fill: var(--coming);
  stroke: #0f1410;
  stroke-width: 1;
  cursor: pointer;
  transition: fill .15s ease, stroke-width .15s ease;
}
.state-path.has-data {
  fill: var(--accent-dim);
}
.state-path:hover,
.state-path:focus {
  fill: var(--highlight);
  stroke-width: 1.5;
  outline: none;
}
.state-path.has-data:hover,
.state-path.has-data:focus {
  fill: var(--accent-hover);
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: #0a100c;
  border: 1px solid var(--border);
  color: var(--text);
  padding: .45rem .7rem;
  border-radius: 8px;
  font-size: .85rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity .12s ease;
  white-space: nowrap;
  z-index: 20;
}
.tooltip.visible { opacity: 1; }
.tooltip .status {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}

/* State page */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}
.breadcrumb {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.state-header h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}
.state-header .meta {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
}
.stat .label { color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.45rem; font-weight: 700; color: var(--highlight); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  align-items: center;
}
.toolbar input,
.toolbar select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .75rem;
  font: inherit;
}
.toolbar input { flex: 1; min-width: 180px; }

.cards {
  display: grid;
  gap: .85rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
}
.card-summary::-webkit-details-marker { display: none; }
.card-summary:hover { background: rgba(61,155,95,.08); }
.card-title {
  margin: 0;
  font-size: 1.1rem;
}
.card-sub {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .2rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
}
.tag {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: rgba(61,155,95,.18);
  color: var(--highlight);
  border: 1px solid rgba(61,155,95,.35);
}
.card-aside {
  text-align: right;
  color: var(--text-muted);
  font-size: .85rem;
  align-self: start;
}
.card-aside strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
}
.card-body {
  padding: 0 1.1rem 1.15rem;
  border-top: 1px solid var(--border);
}
.card-body p { color: var(--text-muted); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.detail {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
}
.detail .k { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.detail .v { font-size: .95rem; }

.leaders { margin-top: .5rem; }
.leader {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.leader:last-child { border-bottom: 0; }
.leader .title { color: var(--text-muted); font-size: .9rem; }
.sources {
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.sources ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.sources a { word-break: break-all; }

.coming-soon {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.coming-soon h2 { margin-top: 0; }
.note-list {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.note-list ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.est { color: var(--warn); font-size: .8rem; font-weight: 600; }

@media (max-width: 640px) {
  .card-summary { grid-template-columns: 1fr; }
  .card-aside { text-align: left; }
}


/* Security-hardening: replace former inline styles */
.loading-msg {
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
}
.text-muted {
  color: var(--text-muted);
}
