.ancestor-hero h1 {
  font-size: clamp(40px, 4.5vw, 72px);
  letter-spacing: -2px;
  overflow-wrap: anywhere;
}

.ancestor-tree,
.ancestor-tree ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ancestor-tree {
  padding: 28px;
  background: #232b25;
  border: 1px solid var(--line);
  max-width: 1050px;
}

.ancestor-tree ul {
  margin-left: 18px;
  padding-left: 22px;
  border-left: 1px solid #66735d;
}

.ancestor-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 15px 20px;
  max-width: 560px;
  border: 1px solid #606e54;
  background: #2d382b;
  transition: background .25s;
}

.ancestor-node:hover {
  background: #394732;
  border-color: var(--green);
}

.ancestor-node span {
  font: 500 21px 'Space Grotesk', sans-serif;
}

.ancestor-node small {
  font-size: 13px;
  color: var(--muted);
}

.ancestor-node.hybrid {
  border-color: #9279b6;
}

.ancestor-node.indica {
  border-color: #719bc3;
}

.ancestor-tree details {
  border: 0;
  padding: 10px 0 15px;
}

.ancestor-tree summary {
  color: var(--green);
  padding: 7px 0 13px;
  font-size: 14px;
}

.edge-label {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  padding: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.edge-label a {
  color: var(--green);
  text-decoration: underline;
}

.branch-end {
  font-size: 13px;
  max-width: 660px;
  color: var(--muted);
  border-left: 2px dashed #626e56;
  padding-left: 15px;
  margin: 12px 0 22px;
}

.lineage-note {
  max-width: 900px;
  color: var(--muted);
}

.lineage-evidence {
  margin-top: 30px;
}

.lineage-evidence ul,
.ancestor-sources {
  list-style: none;
  padding: 0;
}

.lineage-evidence li,
.ancestor-sources li {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.lineage-evidence a,
.ancestor-sources a {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 14px;
}

.lineage-evidence .meta,
.ancestor-sources .meta {
  display: block;
  margin-top: 6px;
}

.descendant-list {
  margin-top: 38px;
}

.descendant-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.descendant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.descendant-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 3px;
  padding: 14px 16px;
  background: var(--panel);
  transition: border-color .2s, background .2s, transform .2s;
}

.descendant-card:hover {
  border-color: var(--green);
  background: #2a332a;
  transform: translateY(-2px);
}

.descendant-card strong {
  font: 500 16px/1.3 'Space Grotesk', sans-serif;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.descendant-card small {
  font-size: 12px;
  color: var(--muted);
}

.descendant-card.hybrid {
  border-left-color: var(--hybrid, #c5a4f3);
}

.descendant-card.indica {
  border-left-color: var(--indica, #9dbdf0);
}

.descendant-card.sativa {
  border-left-color: var(--sativa, #b5d794);
}

.descendant-card.unknown {
  border-left-color: #5a6458;
}

.descendant-list:not(.is-expanded) .descendant-extra {
  display: none;
}

.descendant-actions {
  margin-top: 18px;
}

.descendant-list p {
  color: var(--muted);
}

@media (max-width: 600px) {
  .ancestor-tree {
    padding: 14px;
  }

  .ancestor-tree ul {
    margin-left: 4px;
    padding-left: 12px;
  }

  .ancestor-node {
    padding: 12px;
  }

  .ancestor-node span {
    font-size: 18px;
  }

  .ancestor-node small {
    overflow-wrap: anywhere;
  }

  .edge-label {
    gap: 5px;
  }

  .ancestor-hero h1 {
    font-size: 44px;
  }

  .descendant-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ancestor-node,
  .descendant-card {
    transition: none;
  }
}
