/* ─── Layout ─────────────────────────────────────────────────────────── */
.bh-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.bh-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.bh-sidebar-inner {
  padding: 24px 16px 40px;
}

.bh-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bh-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bh-sidebar-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 7px;
}

.bh-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.bh-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.bh-search-input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 28px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s;
}

.bh-search-input:focus { border-color: var(--accent); }
.bh-search-input::placeholder { color: var(--text-tertiary); }

.bh-sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

/* Size filter pills */
.bh-size-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.bh-size-pill {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .15s;
}

.bh-size-pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
.bh-size-pill.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* Country nav links */
.bh-country-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bh-country-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  transition: background .15s, color .15s;
}

.bh-country-link:hover { background: var(--surface-2); color: var(--text-primary); }
.bh-country-link.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }

.bh-country-flag { font-size: 16px; flex-shrink: 0; }
.bh-country-name { flex: 1; }
.bh-country-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.bh-country-link.active .bh-country-badge { background: rgba(0,113,227,0.12); color: var(--accent); }

.bh-country-link.hidden-country { display: none; }

/* ─── Main ───────────────────────────────────────────────────────────── */
.bh-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  background: var(--bg);
}

/* Page header */
.bh-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.bh-page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.bh-page-sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 480px;
}

.bh-header-stats {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.bh-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 24px;
  border-right: 1px solid var(--border);
  gap: 2px;
}

.bh-header-stat:last-child { border-right: none; }

.bh-header-stat-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.bh-header-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ─── Why birdhouses matter ─────────────────────────────────────────── */
.bh-impact {
  margin-bottom: 40px;
}

.bh-impact-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--surface) 80%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}

.bh-impact-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 12px;
}

.bh-impact-headline {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 12px;
}

.bh-impact-num {
  color: var(--accent);
  white-space: nowrap;
}

.bh-impact-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
  max-width: 620px;
}

.bh-impact-sub strong {
  color: var(--text-primary);
  font-weight: 600;
}

.bh-impact-source {
  font-size: 12px;
  color: var(--text-tertiary);
}

.bh-impact-source a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-tertiary);
  transition: color .15s, border-color .15s;
}

.bh-impact-source a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.bh-impact-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.bh-impact-stat {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.bh-impact-stat-num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--accent);
  line-height: 1;
}

.bh-impact-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 6px;
}

.bh-impact-bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bh-impact-bar-fill {
  height: 100%;
  width: 71%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
}

.bh-impact-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bh-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.bh-impact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.bh-impact-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.bh-impact-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.bh-impact-icon svg { width: 20px; height: 20px; }

.bh-icon-loss     { background: rgba(255, 59, 48, 0.10); color: var(--red); }
.bh-icon-tree     { background: rgba(255, 159, 10, 0.10); color: #C57A00; }
.bh-icon-compete  { background: rgba(191, 90, 242, 0.10); color: #8E3FCC; }
.bh-icon-house    { background: rgba(52, 199, 89, 0.10); color: #1F8F3F; }

[data-theme="dark"] .bh-icon-tree    { color: #FF9F0A; }
[data-theme="dark"] .bh-icon-compete { color: #BF5AF2; }
[data-theme="dark"] .bh-icon-house   { color: #32D74B; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bh-icon-tree    { color: #FF9F0A; }
  :root:not([data-theme="light"]) .bh-icon-compete { color: #BF5AF2; }
  :root:not([data-theme="light"]) .bh-icon-house   { color: #32D74B; }
}

.bh-impact-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.bh-impact-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

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

@media (max-width: 600px) {
  .bh-impact-hero { padding: 22px; }
  .bh-impact-headline { font-size: 20px; }
  .bh-impact-grid { grid-template-columns: 1fr; }
}

/* ─── Size Legend ────────────────────────────────────────────────────── */
.bh-size-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.bh-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  flex: 1;
  min-width: 140px;
  transition: border-color .15s, box-shadow .15s;
  cursor: default;
}

.bh-legend-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.bh-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}

.bh-legend-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.bh-legend-hole {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.bh-legend-birds {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Size dot colors */
.bh-dot-compact  { background: #34C759; }
.bh-dot-standard { background: #0071E3; }
.bh-dot-medium   { background: #FF9F0A; }
.bh-dot-large    { background: #FF375F; }
.bh-dot-xlarge   { background: #BF5AF2; }
.bh-dot-open     { background: #8B6F47; }

/* ─── Country Section ────────────────────────────────────────────────── */
.bh-country-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.bh-country-section.hidden-section { display: none; }

.bh-country-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.bh-country-heading-flag { font-size: 28px; }

.bh-country-heading-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  flex: 1;
}

.bh-country-heading-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ─── Size Group ─────────────────────────────────────────────────────── */
.bh-size-group {
  margin-bottom: 28px;
}

.bh-size-group.hidden-group { display: none; }

.bh-size-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.bh-size-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bh-size-group-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.bh-size-group-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 2px;
}

/* ─── Species Grid ───────────────────────────────────────────────────── */
.bh-species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

/* ─── Species Card ───────────────────────────────────────────────────── */
.bh-species-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.bh-species-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.bh-species-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

/* Icon variants */
.bh-species-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bh-species-icon svg { width: 20px; height: 20px; }

.bh-icon-0 { background: #E8F4FD; color: #0071E3; }
.bh-icon-1 { background: #E8F8EE; color: #34C759; }
.bh-icon-2 { background: #FFF5E6; color: #FF9F0A; }
.bh-icon-3 { background: #FFF0EF; color: #FF375F; }
.bh-icon-4 { background: #F4EEFF; color: #BF5AF2; }
.bh-icon-5 { background: #E5F6FF; color: #5AC8FA; }
.bh-icon-6 { background: #FFF0E8; color: #FF6B35; }

.bh-species-names {
  flex: 1;
  min-width: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.12s ease, color 0.12s ease;
}
.bh-species-names:hover { background: var(--surface-2); }
.bh-species-names:hover .bh-species-common { color: var(--accent); }

.bh-species-common {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s ease;
}

.bh-species-sci {
  display: block;
  font-size: 11px;
  font-style: italic;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hole badge */
.bh-hole-badge {
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.2px;
}

.bh-hole-compact  { background: #E8F8EE; color: #1A8A3A; }
.bh-hole-standard { background: #E8F4FD; color: #005BBB; }
.bh-hole-medium   { background: #FFF5E6; color: #A05F00; }
.bh-hole-large    { background: #FFF0EF; color: #C0251A; }
.bh-hole-xlarge   { background: #F4EEFF; color: #7B30C0; }
.bh-hole-open     { background: #F4EFE5; color: #6B5230; }

/* Spec row */
.bh-spec-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.bh-spec-cell {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 7px 8px;
}

.bh-spec-key {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.bh-spec-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* Feature row */
.bh-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.bh-feat {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}

.bh-feat-yes  { background: var(--green-light); color: var(--green); }
.bh-feat-warn { background: var(--warn-bg); color: var(--warn-text); }

/* Print note */
.bh-print-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
}

.bh-print-icon {
  width: 13px; height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}

/* Habitat tags */
.bh-habitat {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bh-habitat-tag {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 7px;
}

/* ─── No Results ─────────────────────────────────────────────────────── */
.bh-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 15px;
}

.bh-no-results-icon { width: 32px; height: 32px; }

/* Nav active */
.nav-active { color: var(--text-primary) !important; font-weight: 500; }

/* ─── Dark mode overrides for hardcoded colours ──────────────────────── */
[data-theme="dark"] .bh-icon-0 { background: rgba(10,132,255,0.18);  color: #0A84FF; }
[data-theme="dark"] .bh-icon-1 { background: rgba(50,215,75,0.18);   color: #32D74B; }
[data-theme="dark"] .bh-icon-2 { background: rgba(255,159,10,0.18);  color: #FF9F0A; }
[data-theme="dark"] .bh-icon-3 { background: rgba(255,55,95,0.18);   color: #FF375F; }
[data-theme="dark"] .bh-icon-4 { background: rgba(191,90,242,0.18);  color: #BF5AF2; }
[data-theme="dark"] .bh-icon-5 { background: rgba(90,200,250,0.18);  color: #5AC8FA; }
[data-theme="dark"] .bh-icon-6 { background: rgba(255,107,53,0.18);  color: #FF6B35; }

[data-theme="dark"] .bh-hole-open     { background: rgba(139,111,71,0.22);  color: #C9A87A; }
[data-theme="dark"] .bh-hole-compact  { background: rgba(50,215,75,0.18);   color: #32D74B; }
[data-theme="dark"] .bh-hole-standard { background: rgba(10,132,255,0.18);  color: #0A84FF; }
[data-theme="dark"] .bh-hole-medium   { background: rgba(255,159,10,0.18);  color: #FF9F0A; }
[data-theme="dark"] .bh-hole-large    { background: rgba(255,69,58,0.18);   color: #FF453A; }
[data-theme="dark"] .bh-hole-xlarge   { background: rgba(191,90,242,0.18);  color: #BF5AF2; }

[data-theme="dark"] .bh-country-link.active .bh-country-badge { background: rgba(10,132,255,0.18); color: #0A84FF; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bh-icon-0 { background: rgba(10,132,255,0.18);  color: #0A84FF; }
  :root:not([data-theme="light"]) .bh-icon-1 { background: rgba(50,215,75,0.18);   color: #32D74B; }
  :root:not([data-theme="light"]) .bh-icon-2 { background: rgba(255,159,10,0.18);  color: #FF9F0A; }
  :root:not([data-theme="light"]) .bh-icon-3 { background: rgba(255,55,95,0.18);   color: #FF375F; }
  :root:not([data-theme="light"]) .bh-icon-4 { background: rgba(191,90,242,0.18);  color: #BF5AF2; }
  :root:not([data-theme="light"]) .bh-icon-5 { background: rgba(90,200,250,0.18);  color: #5AC8FA; }
  :root:not([data-theme="light"]) .bh-icon-6 { background: rgba(255,107,53,0.18);  color: #FF6B35; }
  :root:not([data-theme="light"]) .bh-hole-open     { background: rgba(139,111,71,0.22);  color: #C9A87A; }
  :root:not([data-theme="light"]) .bh-hole-compact  { background: rgba(50,215,75,0.18);   color: #32D74B; }
  :root:not([data-theme="light"]) .bh-hole-standard { background: rgba(10,132,255,0.18);  color: #0A84FF; }
  :root:not([data-theme="light"]) .bh-hole-medium   { background: rgba(255,159,10,0.18);  color: #FF9F0A; }
  :root:not([data-theme="light"]) .bh-hole-large    { background: rgba(255,69,58,0.18);   color: #FF453A; }
  :root:not([data-theme="light"]) .bh-hole-xlarge   { background: rgba(191,90,242,0.18);  color: #BF5AF2; }
  :root:not([data-theme="light"]) .bh-country-link.active .bh-country-badge { background: rgba(10,132,255,0.18); color: #0A84FF; }
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bh-sidebar { display: none; }
  .bh-main { padding: 24px 20px 60px; }
  .bh-page-header { flex-direction: column; }
  .bh-header-stats { width: 100%; justify-content: stretch; }
  .bh-header-stat { flex: 1; }
  .bh-size-legend { flex-direction: column; }
  .bh-species-grid { grid-template-columns: 1fr; }
  .bh-spec-row { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Timing button (compact, on each species card) ──────────────────── */
.bh-timing-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-align: left;
}

.bh-timing-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.bh-timing-btn span { flex: 1; }

.bh-timing-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.bh-timing-chev {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: .55;
  transition: transform .15s, opacity .15s;
}

.bh-timing-btn:hover .bh-timing-chev {
  opacity: 1;
  transform: translateX(2px);
}

/* ─── Timing modal ───────────────────────────────────────────────────── */
.bh-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bh-modal[hidden] { display: none; }

.bh-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  animation: bh-fade-in .15s ease-out;
}

.bh-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: bh-pop-in .18s cubic-bezier(.2, .9, .35, 1);
}

@keyframes bh-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bh-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bh-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.bh-modal-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 6px;
}

.bh-modal-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 2px;
}

.bh-modal-sci {
  font-size: 13px;
  font-style: italic;
  color: var(--text-tertiary);
}

.bh-modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}

.bh-modal-close svg { width: 14px; height: 14px; }

.bh-modal-close:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red);
}

.bh-modal-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
}

.bh-tm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.bh-tm-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.bh-tm-key {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.bh-tm-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.bh-tm-val.is-yes  { color: #1F8F3F; }
.bh-tm-val.is-no   { color: var(--text-tertiary); font-weight: 500; }
[data-theme="dark"] .bh-tm-val.is-yes { color: #32D74B; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bh-tm-val.is-yes { color: #32D74B; }
}

.bh-tm-section {
  margin-top: 18px;
}

.bh-tm-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.bh-tm-section-icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.bh-tm-pair {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
}

.bh-tm-pair:last-child { border-bottom: none; }

.bh-tm-pair-key {
  font-weight: 500;
  color: var(--text-tertiary);
}

.bh-tm-pair-val {
  color: var(--text-primary);
}

.bh-tm-region {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.bh-tm-region:last-child { margin-bottom: 0; }

.bh-tm-region-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  margin-bottom: 3px;
}

.bh-tm-region-text {
  color: var(--text-secondary);
}

.bh-tm-notes {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .bh-modal { padding: 12px; }
  .bh-modal-panel { max-height: calc(100vh - 24px); }
  .bh-modal-header { padding: 18px 18px 14px; }
  .bh-modal-body { padding: 14px 18px 20px; }
  .bh-tm-grid { grid-template-columns: 1fr 1fr; }
  .bh-tm-pair { grid-template-columns: 90px 1fr; gap: 8px; }
}

/* ─── Science / year-round refuge section ───────────────────────────── */
.bh-science {
  margin-bottom: 44px;
}

.bh-science-head {
  margin-bottom: 18px;
  max-width: 760px;
}

.bh-science-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 8px;
}

.bh-science-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0 0 8px;
}

.bh-science-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.bh-science-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.bh-science-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}

.bh-science-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bh-science-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bh-science-icon svg { width: 18px; height: 18px; }

.bh-science-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  margin: 0;
  line-height: 1.3;
}

.bh-science-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.bh-science-card p:last-of-type { margin-bottom: 0; }

.bh-science-card strong {
  color: var(--text-primary);
  font-weight: 600;
}

.bh-science-source {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

.bh-science-source em {
  font-style: italic;
  color: var(--text-secondary);
}

/* Bottom practical-takeaway callout */
.bh-science-callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.bh-science-callout-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bh-science-callout-icon svg { width: 20px; height: 20px; }

.bh-science-callout h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  margin: 0 0 4px;
}

.bh-science-callout p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 1100px) {
  .bh-science-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .bh-science-grid { grid-template-columns: 1fr; }
  .bh-science-callout { flex-direction: column; gap: 10px; }
}

/* ─── Kit recommendation block (per species card) ───────────────────── */
.bh-kit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 10px 0 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.bh-kit-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.bh-kit-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.bh-kit-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.bh-kit-value {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-primary);
}

.bh-kit-value strong {
  font-weight: 600;
  letter-spacing: -0.1px;
}

.bh-kit-sep {
  margin: 0 4px;
  color: var(--text-tertiary);
}

/* "Ready" state — accent-tinted */
.bh-kit-ready {
  background: var(--accent-light);
  border-color: var(--accent);
}

.bh-kit-ready .bh-kit-icon { color: var(--accent); }
.bh-kit-ready .bh-kit-eyebrow { color: var(--accent); }

/* "Under development" state — neutral/muted */
.bh-kit-pending {
  background: var(--surface-2);
  border-color: var(--border);
  border-style: dashed;
}

.bh-kit-pending .bh-kit-icon { color: var(--text-tertiary); }
.bh-kit-pending .bh-kit-value { color: var(--text-secondary); font-style: italic; }
