:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --card: #121b2f;
  --text: #e6eefb;
  --muted: #9fb0d3;

  --good: #51f28f;
  --warn: #ffd166;
  --bad:  #ff5e7a;

  --brand1: #2dd4bf;
  --brand2: #60a5fa;

  --shadow: 0 10px 30px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.05) inset;
}

/* Base */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
  background:
	radial-gradient(1200px 600px at 10% -10%, rgba(45,212,191,.18), transparent),
	radial-gradient(1200px 600px at 110% -20%, rgba(96,165,250,.15), transparent),
	var(--bg);
  color: var(--text);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */
.hero {
  position: relative;
  padding: 32px 0 32px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
	radial-gradient(800px 400px at 15% -5%, rgba(45,212,191,.25), transparent),
	radial-gradient(800px 400px at 85% -10%, rgba(96,165,250,.25), transparent);
  filter: blur(40px);
  opacity: .8;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__title {
	font-size: 32px;
	line-height: 1.1;
	margin: 0 0 16px;
	font-weight: 800;
	letter-spacing: -.02em;
	text-align: center;
}
.hero__subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 800px;
}

.hero__cta {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Pills */
.pill {
  appearance: none;
  border: 1px solid rgba(255,255,255,.12);
  background: transparent;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: .25s;
  backdrop-filter: blur(8px);
}

.pill:hover { border-color: rgba(255,255,255,.25); }

.pill--active {
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  border-color: transparent;
  box-shadow: var(--shadow);
}

/* Legend */
.legend {
  margin-left: 12px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot--good { background: var(--good); }
.dot--warn { background: var(--warn); }
.dot--bad  { background: var(--bad); }

/* Main */
.main { padding: 24px 20px 40px; }

/* Summary cards */
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  display: none;
}
/* Stack the two summary cards on small screens */
@media (max-width: 860px) {
  .summary {
	grid-template-columns: 1fr;
	gap: 12px;              /* a touch tighter on mobile */
  }
}

.summary__card {
  background: linear-gradient(180deg, rgba(18,27,47,.7), rgba(11,18,32,.7));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.summary__card--alt {
  background: linear-gradient(180deg, rgba(24,35,62,.7), rgba(11,18,32,.7));
}

.summary__title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.summary__value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 6px;
}

.summary__meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* Grid of species cards */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(1, 1fr); }
}

/* Card */
.card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(20,29,48,.85), rgba(10,18,32,.85));
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: .25s transform ease, .25s border-color ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.2);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .3px;
}

/* Text badges (chips) — keep existing semantics */
.badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--muted);
}

.badge--good {
  background: rgba(81,242,143,.12);
  color: #8ff2b8;
  border-color: rgba(81,242,143,.35);
}

.badge--warn {
  background: rgba(255,209,102,.12);
  color: #ffe0a2;
  border-color: rgba(255,209,102,.35);
}

.badge--bad {
  background: rgba(255,94,122,.12);
  color: #ff9caf;
  border-color: rgba(255,94,122,.35);
}

.card__value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
}

.card__stats {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.card__footer {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* Info block */
.info details {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 14px;
}

.info summary {
  cursor: pointer;
  font-weight: 600;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* Modal shell */
.modal {
  border: none;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  padding: 0;
}

.modal__card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: min(1000px, 95vw);
  max-height: 90vh;
  overflow: auto;
  padding: 16px 16px 20px;
}

.modal__close {
  position: sticky;
  top: 0;
  float: right;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.modal__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  color: #072018;
  font-weight: 700;
  cursor: pointer;
}

.btn--subtle {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
}

/* =========================
   Modal readability & title
   ========================= */
#speciesModal { color: var(--text); }
#speciesModal::backdrop { background: rgba(0,0,0,.55); }

#speciesModal h2#modalTitle,
#modalTitle {
  color: #e6f0ff;
  font-weight: 800;
  line-height: 1.2;
  font-size: clamp(20px, 2.4vw, 32px);
  margin: 0 0 8px;
  letter-spacing: .02em;
}

#modalSource {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ==========================================
   Status icon badge (for the round check/dash)
   ========================================== */
.title-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  flex: 0 0 26px;
  /* If JS sets inline colors, these serve as sane defaults */
  background: rgba(34,197,94,.12);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.35);
  color: rgb(34,197,94);
}

.status-badge svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* Palette variants (optional, if you want class-based colors) */
.status-badge--green {
  background: rgba(81,242,143,.12);
  box-shadow: inset 0 0 0 1px rgba(81,242,143,.35);
  color: var(--good);
}

.status-badge--amber {
  background: rgba(255,209,102,.14);
  box-shadow: inset 0 0 0 1px rgba(255,209,102,.38);
  color: var(--warn);
}

.status-badge--red {
  background: rgba(255,94,122,.14);
  box-shadow: inset 0 0 0 1px rgba(255,94,122,.40);
  color: var(--bad);
}

/* A11y helper */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== Full-width CTA bar (above footer) ===== */
.cta-bar {
  width: 100%;
  background: linear-gradient(180deg, rgba(24,35,62,.75), rgba(11,18,32,.85));
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 16px 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.3) inset;
}

.cta-bar__inner {
  display: flex;
  width: 100%;
}

.cta-mail {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  color: #061c15;
  background: linear-gradient(135deg, #2dd4bf, #60a5fa);
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
}

/* (optional) slightly tighter on very small screens */
@media (max-width: 420px) {
  .cta-mail { padding: 12px 14px; }
}