/* ============================================================
iNat Trees — theme, part two
index.html carries a lot of colour in inline <style> blocks (stats cards,
the battle summary, markmap badges and mini-map). Several of those use
!important, so this sheet repeats the palette with enough weight to land.
============================================================ */

/* Bootstrap's own variables, so anything still reading them turns green */
:root {
  --bs-primary: #1f5136;
  --bs-primary-rgb: 31, 81, 54;
  --bs-link-color: #1f5136;
  --bs-link-color-rgb: 31, 81, 54;
  --bs-link-hover-color: #6f9f2f;
  --bs-body-color: #1c2118;
  --bs-body-bg: #faf8f2;
  --bs-border-color: #dcd6c4;
  --bs-danger-rgb: 180, 88, 47;
}

body.dark-theme {
  --bs-body-color: #eef1e6;
  --bs-body-bg: #14170f;
  --bs-border-color: #2c3226;
  --bs-link-color: #8fbf4a;
  --bs-link-hover-color: #b6d97a;
}

/* segmented control / toggle group */
.btn-check:checked + .btn,
.btn-check:active + .btn,
.btn-group .btn.active,
.btn.active,
.btn:first-child:active,
.btn-check:checked + .btn:focus-visible {
  background-color: #1f5136 !important;
  border-color: #163d29 !important;
  color: #f7f4e9 !important;
}

.btn-group > .btn,
.btn-group .btn {
  border-color: #c9c3b0;
  color: #1c2118;
  font-weight: 600;
}

body.dark-theme .btn-group > .btn,
body.dark-theme .btn-group .btn {
  color: #eef1e6;
  border-color: #3a4432;
}

/* ---------- taxonomy stats panels (inline styles in index.html) ---------- */

.taxonomy-stats {
  background-color: #f3efe3 !important;
  border-left: 3px solid #1f5136 !important;
  border-radius: 3px !important;
  box-shadow: none !important;
}

.taxonomy-stats-title {
  color: #1c2118 !important;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600 !important;
}

.taxonomy-stat-card {
  background-color: #fff !important;
  border: 1px solid #dcd6c4 !important;
  border-radius: 3px !important;
  box-shadow: none !important;
}

.taxonomy-stat-card:hover {
  transform: none !important;
  box-shadow: 0 0 0 1px #6f9f2f inset !important;
}

.taxonomy-stat-value {
  color: #1f5136 !important;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600 !important;
}

.taxonomy-stat-label { color: #6f7768 !important; }
.increase { color: #4c7c1f !important; }
.decrease { color: #b4582f !important; }

.user1-stats,
.comparison-stats .user1-stats { border-left-color: #b4582f !important; }
.user2-stats,
.comparison-stats .user2-stats { border-left-color: #2f6f7f !important; }

.user1-stats .taxonomy-stat-value,
.comparison-stats .user1-stats .taxonomy-stat-value { color: #b4582f !important; }
.user2-stats .taxonomy-stat-value,
.comparison-stats .user2-stats .taxonomy-stat-value { color: #2f6f7f !important; }

body.dark-theme .taxonomy-stats {
  background-color: #1b1f16 !important;
  border-left-color: #8fbf4a !important;
  color: #eef1e6 !important;
}
body.dark-theme .taxonomy-stats-title { color: #eef1e6 !important; }
body.dark-theme .taxonomy-stat-card {
  background-color: #202619 !important;
  border-color: #2c3226 !important;
  color: #eef1e6 !important;
}
body.dark-theme .taxonomy-stat-label { color: #c3c9b8 !important; }
body.dark-theme .taxonomy-stat-value { color: #8fbf4a !important; }
body.dark-theme .comparison-stats .user1-stats { border-left-color: #d98055 !important; }
body.dark-theme .comparison-stats .user2-stats { border-left-color: #6fa8bb !important; }
body.dark-theme .comparison-stats .user1-stats .taxonomy-stat-value { color: #d98055 !important; }
body.dark-theme .comparison-stats .user2-stats .taxonomy-stat-value { color: #6fa8bb !important; }

/* ---------- battle / comparison summary ---------- */

.battle-summary {
  background: #f3efe3 !important;
  border: 1px solid #dcd6c4 !important;
  border-left: 3px solid #b4582f !important;
  border-right: 3px solid #2f6f7f !important;
  border-radius: 3px !important;
  box-shadow: none !important;
}

body.dark-theme .battle-summary {
  background: #1b1f16 !important;
  border-color: #2c3226 !important;
  border-left-color: #d98055 !important;
  border-right-color: #6fa8bb !important;
  color: #eef1e6 !important;
}

.battle-user-1 .battle-user-avatar { background: #b4582f !important; }
.battle-user-2 .battle-user-avatar { background: #2f6f7f !important; }

.battle-stat { background: rgba(28, 33, 24, 0.045) !important; border-radius: 3px !important; }
body.dark-theme .battle-stat { background: rgba(238, 241, 230, 0.06) !important; }

.battle-stat-user1 .battle-stat-value { color: #b4582f !important; }
.battle-stat-user2 .battle-stat-value { color: #2f6f7f !important; }
.battle-stat-shared .battle-stat-value { color: #6f8c6f !important; }

.battle-progress { background: rgba(28, 33, 24, 0.1) !important; }
.battle-progress .user1-bar { background: #b4582f !important; }
.battle-progress .shared-bar { background: #8aa88c !important; color: #14210c !important; }
.battle-progress .user2-bar { background: #2f6f7f !important; }

.winner-badge {
  background-color: #e6e0cb !important;
  color: #4a3a12 !important;
  border-radius: 2px !important;
  font-weight: 700;
}

/* ---------- checklist: seen / unseen ---------- */

.seen-node { color: #4c7c1f !important; }
.unseen-node { color: #8e9683 !important; }
.markmap-container svg path.seen-edge { stroke: #6f9f2f !important; }
.markmap-container svg path.unseen-edge,
.markmap-container svg path.missing-edge { stroke: #b7bcaa !important; }
.mm-minimap .seen-edge { stroke: #6f9f2f !important; }
.mm-minimap .unseen-edge { stroke: #b7bcaa !important; }

/* ---------- markmap chrome ---------- */

.mm-toolbar {
  background: rgba(250, 248, 242, 0.92) !important;
  border: 1px solid #dcd6c4 !important;
  border-radius: 3px !important;
  box-shadow: 0 8px 24px -18px rgba(28, 33, 24, 0.8) !important;
}

body.dark-theme .mm-toolbar {
  background: rgba(27, 31, 22, 0.92) !important;
  border-color: #2c3226 !important;
}

.mm-minimap {
  background: rgba(250, 248, 242, 0.86) !important;
  border: 1px solid #dcd6c4 !important;
  border-radius: 3px !important;
  box-shadow: 0 8px 24px -18px rgba(28, 33, 24, 0.8) !important;
}

body.dark-theme .mm-minimap {
  background: rgba(20, 23, 15, 0.7) !important;
  border-color: #2c3226 !important;
}

.mm-minimap .mm-mini-links path,
.mm-minimap .mm-mini-links line,
.mm-minimap .mm-mini-conns line { stroke: #a8ad9b !important; }

.mm-minimap .user1-edge { stroke: #b4582f !important; }
.mm-minimap .user2-edge { stroke: #2f6f7f !important; }
.mm-minimap .shared-edge { stroke: #8aa88c !important; }

.mm-minimap .mm-mini-viewport {
  fill: rgba(111, 159, 47, 0.12) !important;
  stroke: #6f9f2f !important;
}

/* badges */
.mm-badge {
  background: #f3efe3 !important;
  color: #4a5145 !important;
  border: 1px solid #dcd6c4 !important;
  border-radius: 2px !important;
}

.mm-badge.mm-rank {
  background: #e7e9dc !important;
  color: #2b3a22 !important;
  border-color: currentColor !important;
}

.mm-badge.mm-count {
  background: #eef3e2 !important;
  color: #33501c !important;
  border-color: #cdd8b4 !important;
}

.mm-badge.mm-range {
  background: #f6ece4 !important;
  border-color: #d9b79f !important;
  color: #7a3b1e !important;
}

.mm-badge.mm-photo::before { background: #4a5145 !important; }

body.dark-theme .mm-badge {
  background: #202619 !important;
  color: #e6ecdd !important;
  border-color: #2c3226 !important;
}
body.dark-theme .mm-badge.mm-rank { background: #2b3524 !important; color: #eef1e6 !important; }
body.dark-theme .mm-badge.mm-count { background: #24331a !important; color: #cfe6a8 !important; }
body.dark-theme .mm-badge.mm-range { background: #3a2a1c !important; border-color: #7a5636 !important; color: #f0cbaa !important; }
body.dark-theme .mm-badge.mm-photo::before { background: #d7dccb !important; }

/* keyboard hints and misc Bootstrap blue that slips through */
a.text-primary, .link-primary { color: #1f5136 !important; }
body.dark-theme a.text-primary, body.dark-theme .link-primary { color: #8fbf4a !important; }
