.tree-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.tree-scroll {
  overflow: auto;
  max-height: 38rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-0);
}
.tree-scroll svg {
  display: block;
  font: 14px var(--font-sans);
}
.tree-scroll text {
  fill: var(--text-primary);
}
.tree-scroll .tree-legend {
  fill: var(--text-secondary);
  font-size: 12px;
}
.tree-branch {
  stroke: var(--text-secondary);
  stroke-width: 1.3;
  fill: none;
}
.tree-node {
  cursor: pointer;
}
.tree-node .node-mark {
  fill: var(--surface-0);
  stroke: var(--color-loom-600);
  stroke-width: 2;
}
.tree-node[data-collapsed='true'] .node-mark {
  fill: var(--surface-2);
}
.tree-node[data-match='true'] text {
  font-weight: 750;
  text-decoration: underline;
}
.tree-node[aria-pressed='true'] .node-mark {
  fill: var(--color-loom-600);
  stroke-width: 4;
}
.tree-node:focus {
  outline: none;
}
.tree-node:focus .node-mark {
  stroke: var(--text-primary);
  stroke-width: 4;
}
.tree-node:hover text {
  text-decoration: underline;
}
.tree-inspector {
  overflow-wrap: anywhere;
}
.tree-inspector pre {
  white-space: pre-wrap;
  font-size: 0.85rem;
}
.tree-inspector dt {
  color: var(--text-secondary);
}
.tree-inspector dd {
  margin: 0 0 0.75rem;
}
.tree-inspector h2 {
  margin-top: 0;
}
.tree-help {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.tree-drug-glyph {
  font-family: var(--font-mono, monospace);
}
/* loom-700 is 2.8:1 on the dark surface; loom-300 is over 10:1. A property keeps the
   forced-colors rule below at equal specificity, so LinkText still wins there. */
.tree-scroll {
  --tree-link-fill: var(--color-loom-700);
}
.dark .tree-scroll,
[data-theme='dark'] .tree-scroll {
  --tree-link-fill: var(--color-loom-300);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .tree-scroll {
    --tree-link-fill: var(--color-loom-300);
  }
}
.tree-scroll .tree-drug-link text {
  fill: var(--tree-link-fill);
  font-weight: 700;
}
.tree-drug-link:focus {
  outline: none;
}
.tree-drug-link:focus-visible text,
.tree-drug-link:hover text {
  text-decoration: underline;
  stroke: var(--text-primary);
  stroke-width: 0.6;
}
.tree-node .drug-ring {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  stroke-dasharray: 3 2;
}
.tree-node[data-drug-highlight='true'] text {
  font-weight: 750;
}
.tree-drugs {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-0);
  overflow-wrap: anywhere;
}
.tree-drugs[data-state='unavailable'] {
  border-style: dashed;
}
.tree-drugs h2 {
  margin-top: 0;
  font-size: 1.1rem;
}
.tree-drug-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.tree-drug-legend .matrix-glyph,
.drug-block .matrix-glyph,
.drug-block .drug-phase {
  font-family: var(--font-mono, monospace);
}
.tree-drug-chart {
  max-width: 34rem;
}
.tree-drug-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.drug-block {
  margin: 0.9rem 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
}
.drug-block[data-state='not_evaluated'],
.drug-block[data-state='index_unavailable'] {
  border-style: dashed;
}
.drug-block h4 {
  margin: 0 0 0.4rem;
}
.drug-block .drug-state {
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.drug-attribution {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
@media (forced-colors: active) {
  .tree-node .drug-ring {
    stroke: CanvasText;
  }
  .tree-scroll .tree-drug-link text {
    fill: LinkText;
  }
  .tree-drugs,
  .drug-block {
    border-color: CanvasText;
  }
}
@media (max-width: 950px) {
  .tree-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}
