:root {
  color-scheme: light;
  --blue: #3B6EA5;
  --paper-warm: #E3E0CB;
  --olive: #94A02F;
  --navy: #0F304F;
  --forest: #394610;
  --tree-feather-green-fill: #B4D0BC;
  --tree-feather-yellow-fill: #EEA34D;
  --tree-feather-red-fill: #D44720;
  --tree-feather-brown-fill: #AC805C;
  --tree-feather-green-shaft: #A6CAB0;
  --tree-feather-yellow-shaft: #E39444;
  --tree-feather-red-shaft: #C83D1C;
  --tree-feather-brown-shaft: #8D6747;
  --ink: #f7f4df;
  --muted: #bdc4a3;
  --soft: #173b5c;
  --line: rgba(227, 224, 203, 0.24);
  --paper: #0b2945;
  --panel: #0f304f;
  --panel-2: #173b5c;
  --accent: var(--blue);
  --accent-2: var(--olive);
  --accent-soft: rgba(59, 110, 165, 0.18);
  --gold: var(--olive);
  --shadow: 0 18px 48px rgba(15, 48, 79, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background:
    radial-gradient(circle at 18% 0%, rgba(59, 110, 165, 0.18), transparent 34%),
    radial-gradient(circle at 82% 14%, rgba(148, 160, 47, 0.14), transparent 30%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  background: #173b5c;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(420px, 1fr) minmax(320px, 400px);
  height: 100vh;
  overflow: hidden;
  min-height: 100vh;
}

.search-panel,
.tree-panel,
.detail-panel {
  height: 100vh;
  min-height: 100vh;
  overflow: auto;
}

.search-panel {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(15, 48, 79, 0.96), rgba(8, 31, 52, 0.98)),
    var(--navy);
}

.tree-panel {
  position: relative;
  z-index: 1;
  padding: 24px;
  --ink: #223047;
  --muted: #65704d;
  --line: rgba(15, 48, 79, 0.22);
  --panel: #f7f4df;
  --panel-2: #ece8d2;
  --accent-2: var(--blue);
  --accent-soft: rgba(59, 110, 165, 0.18);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(227, 224, 203, 0.98), rgba(214, 211, 187, 0.98)),
    var(--paper-warm);
}

.tree-panel button:hover {
  background: #d7d3b8;
}

.detail-panel {
  position: relative;
  z-index: 3;
  border-left: 1px solid var(--line);
  padding: 24px 18px;
  --ink: #223047;
  --muted: #5b6747;
  --line: rgba(57, 70, 16, 0.3);
  --panel: #f8f5e2;
  --panel-2: #ece8d2;
  --accent-2: var(--blue);
  --accent-soft: rgba(59, 110, 165, 0.18);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(148, 160, 47, 0.96), rgba(57, 70, 16, 0.94)),
    var(--olive);
}

.detail-panel button:hover {
  background: #d7d3b8;
}

.brand {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 72px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(59, 110, 165, 0.34));
}

.brand h1,
.toolbar h2,
.section-head h2,
.detail-title h2 {
  margin: 0;
  line-height: 1.16;
}

.brand h1 {
  font-size: 28px;
}

.byline {
  margin: 5px 0 0;
  color: var(--olive);
  font-size: 12px;
  font-style: italic;
  font-weight: 650;
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-panel .kicker {
  color: var(--olive);
}

.search-box {
  display: block;
  margin-top: 24px;
}

.search-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

.search-box input::placeholder {
  color: #9fac90;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.28);
}

.quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

.quick-list button,
.tool-buttons button,
.ghost-button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.quick-list button {
  position: relative;
  min-height: 26px;
  border: 0;
  border-radius: 0;
  padding: 0 8px 0 14px;
  color: #dfe4bb;
  background: transparent;
}

.quick-list button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.72;
  transform: translateY(-50%);
}

.quick-list button:hover,
.quick-list button:focus-visible {
  color: #f7f4df;
  background: rgba(59, 110, 165, 0.13);
  outline: 0;
}

.quick-list button:hover::before,
.quick-list button:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}

.results-header,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.results-header {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ghost-button {
  color: var(--muted);
}

.results {
  display: grid;
  gap: 2px;
}

.result-item {
  position: relative;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(227, 224, 203, 0.12);
  border-radius: 0;
  padding: 10px 10px 10px 24px;
  text-align: left;
  background: transparent;
}

.result-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--blue);
  opacity: 0.72;
  transform: translateY(-50%);
}

.result-item:hover,
.result-item:focus-visible {
  background: rgba(59, 110, 165, 0.1);
  outline: 0;
}

.result-item:hover::before,
.result-item:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

.result-item.active {
  color: var(--ink);
  background: rgba(59, 110, 165, 0.16);
  box-shadow: none;
}

.result-item.active::before {
  border-left-color: #f2e8aa;
  opacity: 1;
}

.result-name {
  display: block;
  font-weight: 750;
}

.result-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 18px;
  background: linear-gradient(180deg, rgba(227, 224, 203, 0.98) 72%, rgba(227, 224, 203, 0));
}

.toolbar::before {
  content: "";
  position: absolute;
  right: -24px;
  bottom: 100%;
  left: -24px;
  height: 24px;
  background: var(--paper-warm);
}

.tool-buttons {
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(15, 48, 79, 0.18);
  border-radius: 999px;
  background: rgba(247, 244, 223, 0.72);
  box-shadow: inset 0 0 0 1px rgba(227, 224, 203, 0.42);
}

.tool-buttons button {
  height: 30px;
  border: 0;
  border-radius: 0;
  padding: 0 12px;
  color: #243750;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.tool-buttons button + button {
  border-left: 1px solid rgba(15, 48, 79, 0.14);
}

.tool-buttons button:hover,
.tool-buttons button:focus-visible {
  color: #0f304f;
  background: rgba(59, 110, 165, 0.14);
}

.tool-buttons button.active,
.tool-buttons button[aria-pressed="true"] {
  color: #0f304f;
  background: rgba(59, 110, 165, 0.22);
}

.tree {
  position: relative;
  padding: 4px 0 96px;
}

.tree-lines-svg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.tree-lines-svg line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

.tree-lines-svg line.lineage-line {
  stroke: rgba(15, 48, 79, 0.38);
  stroke-width: 2;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 32px;
  position: relative;
}

.tree ul::before {
  content: "";
  position: absolute;
  left: 11px;
  top: var(--branch-line-top, 18px);
  bottom: var(--branch-line-bottom, 18px);
  border-left: 1px solid var(--line);
}

.tree ul.branch-single::before {
  display: none;
}

.tree > ul {
  padding-left: 0;
}

.tree > ul::before {
  display: none;
}

.tree.svg-tree-lines > ul {
  position: relative;
  z-index: 1;
}

.tree.svg-tree-lines ul::before,
.tree.svg-tree-lines li::before,
.tree.svg-tree-lines li::after {
  display: none;
}

.tree li {
  position: relative;
  margin: 6px 0;
}

.tree li::before {
  display: none;
}

.tree ul > li:first-child::before {
  content: "";
  display: block;
  position: absolute;
  left: -21px;
  top: -4px;
  bottom: calc(100% - 18px);
  border-left: 1px solid var(--line);
}

.tree li::after {
  content: "";
  position: absolute;
  left: -21px;
  top: 18px;
  width: 20px;
  border-top: 1px solid var(--line);
}

.tree li.lineage-branch::before {
  display: none;
}

.tree ul > li.lineage-branch:first-child::before {
  display: block;
  width: 2px;
  border-left: 0;
  background:
    linear-gradient(rgba(15, 48, 79, 0.38), rgba(15, 48, 79, 0.38)) left top / 2px 23px no-repeat,
    linear-gradient(var(--line), var(--line)) left top / 1px 100% no-repeat;
}

.tree li.lineage-branch::after {
  border-top-color: rgba(15, 48, 79, 0.38);
  border-top-width: 2px;
}

.tree li.connector-node {
  --connector-midpoint: 50%;
  margin: 0;
  padding-top: 0;
}

.tree li.connector-node::before {
  content: "";
  display: block;
  position: absolute;
  left: -21px;
  top: -4px;
  height: calc(var(--connector-midpoint) + 4px);
  bottom: auto;
  border-left: 1px solid var(--line);
}

.tree li.connector-node.lineage-branch::before {
  display: block;
  width: 2px;
  border-left: 0;
  background:
    linear-gradient(rgba(15, 48, 79, 0.38), rgba(15, 48, 79, 0.38)) left top / 2px 100% no-repeat;
}

.tree li.connector-node::after {
  top: var(--connector-midpoint);
  transform: translateY(-1px);
  width: 20px;
}

.tree li.connector-node > ul {
  position: relative;
  margin-top: 0;
}

.tree li.connector-node > ul::before {
  top: var(--branch-line-top, 18px);
  bottom: var(--branch-line-bottom, 18px);
}

.tree li.connector-node.lineage-branch > ul::before {
  border-left-color: rgba(15, 48, 79, 0.38);
  border-left-width: 2px;
}

.tree li.connector-node > ul > li::before {
  display: none;
}

.tree.svg-tree-lines li.connector-node::before,
.tree.svg-tree-lines li.connector-node::after,
.tree.svg-tree-lines li.connector-node > ul::before {
  display: none;
}

.tree > ul > li::before,
.tree > ul > li::after {
  display: none;
}

.tree.svg-tree-lines ul::before,
.tree.svg-tree-lines li::before,
.tree.svg-tree-lines li::after,
.tree.svg-tree-lines ul > li:first-child::before,
.tree.svg-tree-lines ul > li.lineage-branch:first-child::before,
.tree.svg-tree-lines li.connector-node::before,
.tree.svg-tree-lines li.connector-node::after,
.tree.svg-tree-lines li.connector-node > ul::before {
  display: none;
}

.node-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 3px 7px;
}

.node-row:hover {
  background: rgba(59, 110, 165, 0.08);
}

.node-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.node-row.in-lineage:not(.selected) {
  border-left-color: var(--olive);
  border-left-width: 4px;
  padding-left: 4px;
  background: rgba(247, 244, 223, 0.72);
  box-shadow: inset 0 0 0 1px rgba(148, 160, 47, 0.18);
}

.tree-feather-assets-demo .node-row {
  position: relative;
  isolation: isolate;
  --tree-feather-fill-x: 38px;
  --tree-feather-fill-width: calc(100% - 82px);
  --tree-feather-fill-y: 50%;
  --tree-feather-fill-height: calc(100% - 1px);
  --tree-feather-shaft-y: calc(50% + 17px);
  --tree-feather-shaft-height: 3px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  margin-left: 20px;
  margin-right: 8px;
  padding: 6px 18px 6px 42px;
  background: transparent;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.tree-feather-assets-demo .node-row::before {
  content: "";
  position: absolute;
  top: -7px;
  bottom: -7px;
  left: -28px;
  z-index: -1;
  width: 116px;
  background: var(--tree-feather-left) left calc(50% - 2px) / auto 100% no-repeat;
  pointer-events: none;
}

.tree-feather-assets-demo .node-row::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -18px;
  bottom: -7px;
  z-index: -1;
  width: 108px;
  background: var(--tree-feather-right) right calc(50% - 2px) / auto 104% no-repeat;
  pointer-events: none;
}

.tree-feather-assets-demo .node-row.feather-green {
  --tree-feather-left: url("./assets/tree-feather-green-left.png");
  --tree-feather-right: url("./assets/tree-feather-green-right.png?v=2");
  --tree-feather-fill: var(--tree-feather-green-fill);
  --tree-feather-shaft: var(--tree-feather-green-shaft);
}

.tree-feather-assets-demo .node-row.feather-yellow {
  --tree-feather-left: url("./assets/tree-feather-yellow-left.png");
  --tree-feather-right: url("./assets/tree-feather-yellow-right.png?v=2");
  --tree-feather-fill: var(--tree-feather-yellow-fill);
  --tree-feather-shaft: var(--tree-feather-yellow-shaft);
}

.tree-feather-assets-demo .node-row.feather-red {
  --tree-feather-left: url("./assets/tree-feather-red-left.png");
  --tree-feather-right: url("./assets/tree-feather-red-right.png?v=2");
  --tree-feather-fill: var(--tree-feather-red-fill);
  --tree-feather-shaft: var(--tree-feather-red-shaft);
}

.tree-feather-assets-demo .node-row.feather-brown {
  --tree-feather-left: url("./assets/tree-feather-brown-left.png?v=3");
  --tree-feather-right: url("./assets/tree-feather-brown-right.png?v=3");
  --tree-feather-fill: var(--tree-feather-brown-fill);
  --tree-feather-shaft: var(--tree-feather-brown-shaft);
}

.tree-feather-assets-demo .node-row:hover,
.tree-feather-assets-demo .node-row.selected,
.tree-feather-assets-demo .node-row.in-lineage:not(.selected) {
  background-color: transparent;
}

.tree-feather-assets-demo .node-row:hover {
  box-shadow: none;
  filter: none;
  transform: translateY(-3px);
}

.tree-feather-assets-demo .node-row.selected {
  outline: 0;
  box-shadow: none;
}

.tree-feather-assets-demo .node-row.in-lineage:not(.selected) {
  border-left: 0;
  padding-left: 42px;
  box-shadow: none;
}

.tree-feather-assets-demo .node-row:hover::before,
.tree-feather-assets-demo .node-row:hover::after {
  filter: saturate(1.06) brightness(1.02);
}

.tree-feather-assets-demo .node-main:hover,
.tree-feather-assets-demo .node-main:focus-visible,
.tree-feather-assets-demo .twisty:hover,
.tree-feather-assets-demo .twisty:focus-visible {
  border-color: transparent;
  background: transparent;
  outline: 0;
}

.tree-feather-assets-demo .node-row:hover .node-name {
  color: #10283f;
}

.tree-feather-assets-demo .feather-fill {
  position: absolute;
  z-index: -2;
  width: var(--tree-feather-fill-width);
  height: var(--tree-feather-fill-height);
  top: var(--tree-feather-fill-y);
  left: var(--tree-feather-fill-x);
  transform: translateY(-50%);
  background:
    repeating-linear-gradient(90deg, var(--tree-feather-shaft) 0 10px, transparent 10px 16px) 0 var(--tree-feather-shaft-y) / 100% var(--tree-feather-shaft-height) no-repeat,
    linear-gradient(var(--tree-feather-fill), var(--tree-feather-fill)) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

.tree-feather-assets-demo .node-row:hover .feather-fill {
  background:
    repeating-linear-gradient(90deg, var(--tree-feather-shaft) 0 10px, transparent 10px 16px) 0 var(--tree-feather-shaft-y) / 100% var(--tree-feather-shaft-height) no-repeat,
    linear-gradient(color-mix(in srgb, var(--tree-feather-fill) 88%, white), color-mix(in srgb, var(--tree-feather-fill) 88%, white)) 0 0 / 100% 100% no-repeat;
}

.tree-feather-assets-demo .feather-shadow {
  position: absolute;
  top: 1px;
  right: -42px;
  bottom: -2px;
  left: -42px;
  z-index: -3;
  border-radius: 55% 45% 48% 52% / 45% 52% 48% 55%;
  background:
    radial-gradient(ellipse at 56% 57%, rgba(15, 48, 79, 0.34) 0 26%, rgba(15, 48, 79, 0.18) 46%, transparent 76%),
    linear-gradient(90deg, transparent 0 2%, rgba(15, 48, 79, 0.12) 13%, rgba(15, 48, 79, 0.22) 52%, rgba(15, 48, 79, 0.1) 86%, transparent 100%);
  filter: blur(9px);
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  transform: translate(3px, 4px);
}

.tree-feather-assets-demo .node-row:hover .feather-shadow {
  opacity: 1;
  transform: translate(-4px, 6px);
}

.tree-feather-assets-demo .node-name,
.tree-feather-assets-demo .node-sub {
  position: relative;
  z-index: 1;
}

.tree-feather-assets-demo .node-main,
.tree-feather-assets-demo .twisty,
.tree-feather-assets-demo .rank-pill {
  position: relative;
  z-index: 1;
}

.tree-feather-assets-demo .rank-pill {
  background: rgba(247, 244, 223, 0.64);
}

.tree-feather-assets-demo .node-row.in-lineage .rank-pill::before {
  content: "★";
  position: absolute;
  top: 50%;
  left: -18px;
  color: #0f304f;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(247, 244, 223, 0.45);
  transform: translateY(-50%);
}

.tree-feather-assets-demo .node-row.selected .rank-pill::before {
  color: #F2E8AA;
  font-size: 13px;
  text-shadow:
    0 1px 0 rgba(15, 48, 79, 0.3),
    0 0 6px rgba(247, 244, 223, 0.56);
}

.tree-feather-assets-demo .node-sub {
  color: rgba(15, 48, 79, 0.78);
}

.twisty {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  padding: 0;
  line-height: 1;
}

.twisty.empty {
  visibility: hidden;
}

.node-main {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.node-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-sub {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-pill {
  border: 1px solid rgba(59, 110, 165, 0.24);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--navy);
  background: rgba(59, 110, 165, 0.14);
  font-size: 11px;
  text-transform: uppercase;
}

.detail-block {
  position: relative;
  border: 0;
  border-radius: 10px 4px 8px 5px / 5px 11px 6px 9px;
  padding: 16px;
  margin: 0 4px 19px 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 42%),
    var(--panel);
  box-shadow:
    -3px 0 0 rgba(57, 70, 16, 0.62),
    0 0 0 1px rgba(57, 70, 16, 0.3),
    0 10px 0 rgba(57, 70, 16, 0.08),
    0 18px 26px rgba(25, 36, 10, 0.22);
  transform: none;
  transform-origin: 50% 12px;
}

.detail-block:nth-of-type(even) {
  margin-right: 0;
  margin-left: 5px;
  border-radius: 5px 12px 10px 10px / 10px 4px 9px 5px;
  transform: none;
}

.detail-block:nth-of-type(3n) {
  margin-left: 1px;
  margin-right: 6px;
  border-radius: 7px 5px 6px 3px / 4px 9px 8px 12px;
  transform: none;
}

.detail-block::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 18px;
  width: 56px;
  height: 14px;
  border: 1px solid rgba(57, 70, 16, 0.16);
  border-radius: 2px;
  background: rgba(227, 224, 203, 0.62);
  box-shadow: 0 2px 4px rgba(25, 36, 10, 0.12);
  transform: rotate(-2deg);
  pointer-events: none;
}

.detail-block:nth-of-type(even)::before {
  right: 24px;
  left: auto;
  transform: rotate(2deg);
}

.primary-detail {
  transform: rotate(0deg);
  margin-right: 1px;
  margin-left: 1px;
  border-radius: 8px 4px 7px 5px / 5px 10px 6px 8px;
}

.primary-detail::before {
  width: 72px;
  background: rgba(59, 110, 165, 0.16);
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title > div {
  min-width: 0;
}

.detail-title .rank-pill {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 4px;
  padding: 5px 9px;
  line-height: 1;
  white-space: nowrap;
}

.latin {
  color: var(--muted);
  font-style: italic;
}

.summary {
  margin: 14px 0 0;
  color: #334258;
  line-height: 1.58;
}

.summary-empty {
  color: #7d856a;
  font-size: 13px;
  font-style: italic;
}

.facts {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.fact {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.fact strong {
  color: var(--ink);
}

.citation-popover {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px dotted rgba(59, 110, 165, 0.58);
  color: #3b6ea5;
  cursor: help;
  font-weight: 700;
}

.citation-popover a {
  color: inherit;
  text-decoration: none;
}

.citation-note {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(calc(-50% + var(--citation-shift, 0px)));
  z-index: 20;
  display: none;
  width: min(200px, calc(100vw - 32px));
  border: 1px solid rgba(15, 48, 79, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: #243750;
  background: #f8f5e2;
  box-shadow: 0 12px 28px rgba(15, 48, 79, 0.18);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.citation-note-wide {
  width: min(260px, calc(100vw - 32px));
}

.related-species-note span {
  display: block;
}

.citation-popover:hover .citation-note,
.citation-popover:focus .citation-note,
.citation-popover:focus-within .citation-note {
  display: block;
}

.trait-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.trait-list li {
  border: 1px solid rgba(148, 160, 47, 0.24);
  border-left: 3px solid var(--gold);
  padding: 7px 10px;
  background: #f2edc7;
  line-height: 1.45;
}

.lineage-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.lineage-list li {
  color: var(--muted);
}

.lineage-list button {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  text-align: left;
}

.comparison-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.comparison-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-2);
}

.comparison-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.comparison-card p {
  margin: 0;
  color: #334258;
  font-size: 13px;
  line-height: 1.48;
}

.inline-taxon-link {
  display: inline;
  border: 0;
  padding: 0;
  color: #3b6ea5;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}

.inline-taxon-link:hover,
.inline-taxon-link:focus-visible {
  color: #0f304f;
}

.comparison-card .mini {
  margin-top: 8px;
  color: var(--muted);
}

.source-block .kicker {
  color: #3b6ea5;
}

#sourceNote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-list > span,
.source-status {
  display: block;
}

.source-list strong {
  color: var(--forest);
}

.source-list a {
  color: #3b6ea5;
  text-decoration: none;
}

.source-list a:hover {
  text-decoration: underline;
}

.source-status {
  margin-top: 12px;
  color: var(--forest);
  font-size: 12px;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(247, 244, 223, 0.54);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 300px 1fr;
  }

  .detail-panel {
    grid-column: 1 / -1;
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    height: auto;
    overflow: visible;
  }

  .search-panel,
  .tree-panel,
  .detail-panel {
    height: auto;
    min-height: auto;
    border: 0;
  }

  .tree-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar {
    position: static;
  }

  .tree {
    width: clamp(390px, 104vw, 480px);
    min-width: 390px;
    padding-right: 12px;
  }

  .tree ul {
    padding-left: 16px;
  }

  .tree-feather-assets-demo .node-row {
    --tree-feather-fill-x: 30px;
    --tree-feather-fill-width: calc(100% - 64px);
    --tree-feather-shaft-y: calc(50% + 13px);
    width: clamp(180px, 54vw, 240px);
    min-width: 180px;
    min-height: 36px;
    grid-template-columns: 20px minmax(54px, 1fr) max-content;
    gap: 6px;
    margin-left: 14px;
    margin-right: 4px;
    padding: 5px 11px 5px 34px;
  }

  .tree-feather-assets-demo .node-row::before {
    top: -5px;
    bottom: -5px;
    left: -22px;
    width: 92px;
  }

  .tree-feather-assets-demo .node-row::after {
    top: -5px;
    right: -14px;
    bottom: -5px;
    width: 86px;
  }

  .tree-feather-assets-demo .node-row.in-lineage:not(.selected) {
    padding-left: 34px;
  }

  .twisty {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    font-size: 16px;
  }

  .node-name {
    font-size: 12px;
  }

  .node-sub {
    font-size: 10px;
  }

  .rank-pill {
    padding: 3px 7px;
    font-size: 10px;
  }

  .tool-buttons {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .brand {
    grid-template-columns: 64px 1fr;
  }

  .brand-logo {
    width: 64px;
    height: 46px;
  }
}
