.life-shell {
  max-width: 1400px;
  margin: 0 auto;
  background: radial-gradient(circle at 12% 6%, rgba(61, 127, 199, 0.24), transparent 34%),
    radial-gradient(circle at 88% 9%, rgba(69, 151, 118, 0.2), transparent 30%),
    linear-gradient(160deg, #111923, #162334 55%, #1a2b3f);
  border: 1px solid #22344d;
  border-radius: 14px;
  padding: 1rem;
}

.life-hero h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  color: #eaf4ff;
}

.life-hero p {
  margin: 0.35rem 0 0.9rem;
  color: #9fc0df;
  font-size: 0.9rem;
}

.life-hero {
  border: 1px solid #2d4565;
  border-radius: 12px;
  padding: 0.9rem 1rem 0.8rem;
  background: linear-gradient(125deg, #17283d, #1d3554 55%, #1b4251);
  margin-bottom: 0.8rem;
}

.life-hero-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.life-hero-kicker {
  display: inline-block;
  font-size: 0.7rem;
  color: #cbe2ff;
  border: 1px solid #5c81b5;
  border-radius: 999px;
  padding: 0.2rem 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(12, 29, 53, 0.48);
}

.life-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.life-hero-badges span {
  font-size: 0.68rem;
  color: #d5e8ff;
  background: rgba(14, 35, 58, 0.6);
  border: 1px solid #44658f;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
}

.life-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.life-toolbar-actions {
  display: flex;
  gap: 0.4rem;
}

.life-toolbar-search input {
  width: 100%;
  height: 35px;
  border: 1px solid #385274;
  border-radius: 8px;
  background: #0f1b2a;
  color: #edf6ff;
  padding: 0 0.7rem;
}

.life-toolbar-meta {
  color: #9fc0df;
  font-size: 0.82rem;
  white-space: nowrap;
}

.life-tree-frame {
  border: 1px solid #2c425f;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f1825, #101b2b);
  max-height: 72vh;
  overflow: auto;
  padding: 0.9rem;
}

.tree-view {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}

.tree-view ul {
  list-style: none;
  margin: 0 0 0 1rem;
  padding: 0 0 0 1rem;
  border-left: 1px dashed #2f4a6e;
}

.tree-view > li > a {
  color: #a9cef7;
  text-decoration: none;
  font-size: 0.86rem;
}

.tree-view li {
  position: relative;
  list-style: none;
  margin: 0.33rem 0;
}

.tree-view li::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.95rem;
  width: 1rem;
  border-top: 1px dashed #2f4a6e;
}

.tree-view > li::before {
  display: none;
}

.tree-view details {
  border-left: 3px solid transparent;
}

.tree-view summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(180deg, #18273b, #152338);
  border: 1px solid #2f496e;
  border-radius: 10px;
  padding: 0.38rem 0.48rem;
  color: #deebfa;
  cursor: pointer;
}

.tree-view summary::-webkit-details-marker {
  display: none;
}

.tree-view summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 99px;
  background: #0f1b2a;
  border: 1px solid #446896;
  color: #87b7ef;
  font-weight: 700;
  font-size: 0.75rem;
  flex: 0 0 auto;
}

.tree-view details[open] > summary::before {
  content: "-";
}

.tree-view summary > span:first-of-type {
  font-size: 0.8rem;
  flex: 0 1 auto;
}

.tree-view summary button {
  border: 1px solid #486b95;
  border-radius: 7px;
  padding: 0.08rem 0.35rem;
  color: #e8f4ff;
  background: #173450;
}

.tree-view summary button.bg-danger {
  background: #53293a !important;
  border-color: #92506b;
}

.tree-view summary button.bg-success {
  background: #204938 !important;
  border-color: #4f8e73;
}

.tree-view summary button.bg-primary {
  background: #1d3f67 !important;
  border-color: #507db3;
}

.tree-view summary.rank-domain {
  border-left: 3px solid #77d2ff;
}

.tree-view summary.rank-kingdom {
  border-left: 3px solid #82caff;
}

.tree-view summary.rank-phylum {
  border-left: 3px solid #8dc4ff;
}

.tree-view summary.rank-class {
  border-left: 3px solid #96bcff;
}

.tree-view summary.rank-order {
  border-left: 3px solid #a4b5ff;
}

.tree-view summary.rank-family {
  border-left: 3px solid #b0adff;
}

.tree-view summary.rank-genus {
  border-left: 3px solid #bfa7ff;
}

.tree-view summary.rank-specie,
.tree-view summary.rank-species {
  border-left: 3px solid #c8a5ff;
}

.tree-view summary.rank-breed {
  border-left: 3px solid #d79cff;
}

.tree-view li.life-filter-hidden {
  display: none !important;
}

.tree-view summary.life-best-match {
  box-shadow: 0 0 0 1px #58a9ff inset, 0 0 14px rgba(74, 153, 244, 0.2);
}

.tree-view summary.life-top-hit {
  border-color: #80c1ff;
  box-shadow: 0 0 0 1px #80c1ff inset, 0 0 20px rgba(90, 168, 255, 0.35);
}

.life-score {
  display: inline-block;
  color: #8fd2ff;
  font-weight: 700;
  margin-left: 0.18rem;
  margin-right: 0.35rem;
  font-size: 0.75rem;
}

.life-score:empty {
  display: none;
}

.tree-view summary button:first-of-type {
  margin-left: auto;
}

@media (max-width: 991.98px) {
  .life-toolbar {
    grid-template-columns: 1fr;
  }
}
