:root {
  --top-predator: #0072b2;
  --mesopredator: #009e73;
  --forage-prey: #e69f00;
  --diadromous: #cc79a7;
  --freshwater-stray: #56b4e9;
  --invasive-species: #d55e00;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0 16px;
  background: #fff;
  color: #222;
}

header h1 {
  font-size: 1.5rem;
  padding: 16px 0 8px;
  margin: 0;
}

nav.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  border-bottom: 3px solid #0072b2;
  font-weight: 600;
}

.tab-btn.disabled {
  color: #aaa;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

.tab-panel { display: none; max-width: 1800px; margin: 0 auto 40px; }

.side-by-side {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.side-col { min-width: 0; }
.side-col-main { flex: 3 1 480px; }
.side-col-secondary { flex: 2 1 300px; }
.side-col-half { flex: 1 1 420px; }
.future-img { max-width: 1500px; }
.trends-img { max-width: 1300px; }
.heatmap-img { max-width: 900px; }
.affinity-img { max-width: 1000px; }
.methods-img { max-width: 1000px; }

/* Methods tab: one card per scoring curve */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px;
  margin: 20px 0;
  max-width: 1300px;
}
.method-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 16px 8px;
  line-height: 1.45;
}
.method-card h3 { font-size: 1.05rem; margin: 12px 0 6px; }
.formula {
  font-family: "Cambria Math", "Times New Roman", serif;
  background: #f7f7f7;
  padding: 6px 10px;
  border-radius: 4px;
  overflow-x: auto;
}
.formula-inline { font-family: "Cambria Math", "Times New Roman", serif; white-space: nowrap; }
.refs { font-size: 0.85rem; color: #555; }

.info-box {
  background: #f4f8fb;
  border-left: 4px solid #0072b2;
  padding: 4px 16px;
  margin: 4px 0 16px;
  max-width: 1100px;
  line-height: 1.45;
}
.tab-panel.active { display: block; }

select {
  font-size: 1rem;
  padding: 6px 10px;
  margin-right: 10px;
}

.role-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 0.85em;
}

.role-badge.Large_Predator { background-color: var(--top-predator); }
.role-badge.Mesopredator { background-color: var(--mesopredator); }
.role-badge.Forage_Prey { background-color: var(--forage-prey); }
.role-badge.Diadromous { background-color: var(--diadromous); }
.role-badge.Freshwater_Stray { background-color: var(--freshwater-stray); }
.role-badge.Invasive_Species { background-color: var(--invasive-species); }

.caption { color: #555; margin: 12px 0 6px; }

.result-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  margin-top: 8px;
}

footer {
  color: #888;
  font-size: 0.85rem;
  padding: 20px 0 40px;
  border-top: 1px solid #eee;
  margin-top: 20px;
}
