@font-face {
  font-family: "Figtree";
  src: url("assets/figtree/Figtree-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/figtree/Figtree-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/figtree/Figtree-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/figtree/Figtree-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/figtree/Figtree-ExtraBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/figtree/Figtree-Black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

.highlight {
  stroke: #1976d2 !important;
}

text.highlight {
  fill: #0d47a1 !important;
  font-weight: 700 !important;
  paint-order: stroke fill;
  stroke: white !important;
  stroke-width: 4px !important;
  stroke-linejoin: round !important;
}

/* ── Search-active overlay ─────────────────────────────────────────────────
   When a focused-tree search is running, hide everything not on a match path.
   Major Groups adds .search-context-preserved so its overview stays intact.
   .match-path      = node is on the path from root to a search result
   .match-path-link = link connects two match-path nodes (shown in gray)
   .search-active   = applied to the SVG while a search is active
   ──────────────────────────────────────────────────────────────────────── */
.search-active:not(.search-context-preserved) g.node:not(.match-path) {
  opacity: 0;
  pointer-events: none;
}

/* Force-hide label text for non-match nodes (overrides culling display:block) */
.search-active:not(.search-context-preserved) g.node:not(.match-path) text {
  display: none !important;
}

/* Keep labels visible for all nodes that belong to a matched path. */
.search-active g.node.match-path text:not(.toggle):not(.label-halo) {
  display: block !important;
}

/* Force-show highlighted matching nodes with the same visibility guarantee. */
.search-active g.node.match-path text.highlight,
.search-active g.node.match-path text.highlight-synonym,
.search-active g.node.match-path text.highlight-q1,
.search-active g.node.match-path text.highlight-q2 {
  display: block !important;
}

.search-active g.node.match-path text.path-context-hidden:not(.toggle):not(.label-halo) {
  display: none !important;
}

/* Hide all links that are not highlighted and not on any match path */
.search-active:not(.search-context-preserved) path:not(.highlight):not(.highlight-synonym):not(.highlight-q1):not(.highlight-q2):not(.match-path-link) {
  opacity: 0;
}

/* Match-path links between shared ancestors: keep visible as gray structure */
.search-active path.match-path-link:not(.highlight):not(.highlight-synonym) {
  opacity: 0.5;
  stroke: #9aa0a6;
}

#chart svg text {
  font-size: 11px;
  font-family: "Figtree", sans-serif;
  font-optical-sizing: auto;
}

/*
 * Chromium's native find-in-page renderer corrupts highlighted substrings
 * inside stroked SVG text. Keep searchable labels completely unstroked and
 * retain their white separation from links with a compositor-safe shadow.
 */
#chart svg text:not(.toggle) {
  paint-order: normal !important;
  stroke: none !important;
  stroke-width: 0 !important;
  text-shadow:
    -1px -1px 0 #fff,
    0 -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 0 0 #fff,
    1px 0 0 #fff,
    -1px 1px 0 #fff,
    0 1px 0 #fff,
    1px 1px 0 #fff;
}

/* Root center label at tree origin */
.root-center-label text {
  font-family: "Figtree", sans-serif;
}

/* The radial tree has a dedicated center badge, so its duplicate root node
   label must stay hidden even when path highlighting forces labels visible. */
.root-taxon-label {
  display: none !important;
}

.root-center-label.is-path-highlighted circle {
  stroke: #1976d2;
  stroke-width: 2.5px;
}

.root-center-label.is-path-highlighted text {
  fill: #0d47a1 !important;
}


body {
  font-family: "Figtree", system-ui, sans-serif;
  font-optical-sizing: auto;
  background-color: #e8f5e9;
  padding: 20px;
  margin: 0;
}

#title-section {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 0 24px 8px 0;
  border-radius: 16px;
}

#title-section h1 {
  min-width: 0;
  flex: 1 1 auto;
  color: #43a047;
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
  text-align: left;
  text-wrap: balance;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-nav {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  z-index: 30;
}

.view-nav-trigger {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(67, 160, 71, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(22, 101, 52, 0.12);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.view-nav-trigger:hover,
.view-nav:focus-within .view-nav-trigger,
.view-nav.open .view-nav-trigger {
  border-color: #43a047;
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.18);
  transform: translateY(-1px);
}

.view-nav-icon {
  width: 17px;
  height: 13px;
  display: inline-block;
  position: relative;
  border-top: 2px solid #2e7d32;
  border-bottom: 2px solid #2e7d32;
}

.view-nav-icon::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 17px;
  border-top: 2px solid #2e7d32;
}

.view-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 176px;
  padding: 6px;
  border: 1px solid #dcefe0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.view-nav:hover .view-nav-menu,
.view-nav.open .view-nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.view-nav-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #374151;
  padding: 9px 10px;
  font-family: "Figtree", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.view-nav-option:hover,
.view-nav-option:focus {
  background: #eef8ef;
  color: #2e7d32;
  outline: none;
}

.view-nav-option.active {
  background: #43a047;
  color: #ffffff;
}

.view-nav-option.is-disabled {
  color: #9ca3af;
  cursor: default;
}

.view-nav-option.is-disabled::after {
  content: 'Soon';
  font-size: 10px;
  font-weight: 800;
  color: #9ca3af;
}

.view-nav-option.is-disabled:hover,
.view-nav-option.is-disabled:focus {
  background: transparent;
  color: #9ca3af;
}

body:not([data-app-view="steward"]) #summary-panel,
body:not([data-app-view="steward"]) #synonym-bar,
body:not([data-app-view="steward"]) #synonym-detail-panel,
body:not([data-app-view="steward"]) #anomaly-bar,
body:not([data-app-view="steward"]) #anomaly-detail-panel,
body:not([data-app-view="steward"]) #steward-taxon-detail {
  display: none !important;
}

/* Data Steward: resolved invalid-name relationships. */
.synonym-relationships-bar {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #ead9c6;
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: 0 1px 2px rgba(83, 52, 23, 0.03);
}

.synonym-relationships-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  width: 100%;
  gap: 12px;
  min-height: 26px;
  padding: 12px;
  border: 0;
  color: #3f352b;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.synonym-relationships-summary:hover,
.synonym-relationships-summary:focus-visible {
  background: #fff8ef;
}

.synonym-relationships-summary:focus-visible {
  outline: 2px solid #c98036;
  outline-offset: -2px;
}

.synonym-relationships-summary-copy {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.synonym-relationships-summary-copy strong {
  color: #3e352d;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.synonym-relationships-summary-spacer {
  visibility: hidden;
}

.synonym-relationships-summary-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #784a20;
  background: #f8ead8;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.synonym-relationships-summary-action {
  color: #a45b1b;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.synonym-relationships-panel {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #ead9c6;
  border-radius: 10px;
  background: #fff;
}

.synonym-relationships-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.synonym-relationships-panel-header h3 {
  margin: 0;
  color: #3e352d;
  font-size: 14px;
  font-weight: 700;
}

.synonym-relationships-panel-header p {
  margin: 3px 0 0;
  color: #74695f;
  font-size: 10px;
  line-height: 1.4;
}

.synonym-relationships-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #7b6b5d;
  background: transparent;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.synonym-relationships-close:hover,
.synonym-relationships-close:focus-visible {
  background: #fff5e9;
}

.synonym-relationships-table-wrap {
  max-height: 390px;
  overflow: auto;
  border-top: 1px solid #efe4d8;
}

.synonym-relationships-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: #433b34;
  font-size: 11px;
  text-align: left;
}

.synonym-relationships-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #e9ddcf;
  color: #74695f;
  background: #fcf8f3;
  font-weight: 700;
  white-space: nowrap;
}

.synonym-relationships-table td {
  padding: 10px;
  border-bottom: 1px solid #f2ebe4;
  vertical-align: top;
}

.synonym-relationships-table tbody tr:last-child td {
  border-bottom: 0;
}

.synonym-relationship-name {
  width: 27%;
}

.synonym-relationship-name span,
.synonym-relationship-name small {
  display: block;
}

.synonym-relationship-name span {
  font-weight: 650;
}

.synonym-relationship-name small {
  margin-top: 2px;
  color: #8b8178;
  font-size: 10px;
}

.synonym-relationship-name--invalid span {
  color: #965318;
  font-style: italic;
}

.synonym-relationship-name--valid span {
  color: #2f743e;
}

.synonym-relationship-type {
  width: 31%;
  color: #655b52;
  line-height: 1.4;
}

.synonym-relationship-date {
  color: #74695f;
  white-space: nowrap;
}

.synonym-relationships-empty {
  padding: 28px 14px !important;
  color: #887b70;
  text-align: center;
}

/* Data Steward: potential-taxonomic-issues review queue. */
.taxonomic-issues-bar {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #dce5de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 54, 35, 0.03);
}

.taxonomic-issues-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  width: 100%;
  gap: 12px;
  min-height: 26px;
  padding: 12px;
  border: 0;
  color: #27332c;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.taxonomic-issues-summary:hover,
.taxonomic-issues-summary:focus-visible {
  background: #f6f9f7;
}

.taxonomic-issues-summary:focus-visible {
  outline: 2px solid #43a047;
  outline-offset: -2px;
}

.taxonomic-issues-summary-copy {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.taxonomic-issues-summary-copy strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.taxonomic-issues-summary-spacer {
  visibility: hidden;
}

.taxonomic-issues-summary-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #39443d;
  background: #edf1ee;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.taxonomic-issues-summary-action {
  color: #2f7d3b;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.taxonomic-issues-panel {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #dfe6e1;
  border-radius: 10px;
  background: #fff;
}

.taxonomic-issues-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.taxonomic-issues-panel-header h3 {
  margin: 0;
  color: #27332c;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.taxonomic-issues-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #68726b;
  background: transparent;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.taxonomic-issues-close:hover,
.taxonomic-issues-close:focus-visible {
  background: #f0f3f1;
}

.taxonomic-issues-toolbar {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.taxonomic-issues-toolbar select {
  width: 168px;
  min-width: 168px;
  height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid #ced6d0;
  border-radius: 7px;
  color: #303a33;
  background-color: #fff;
  font: inherit;
  font-size: 12px;
}

@media (max-width: 430px) {
  .taxonomic-issues-panel-header {
    gap: 8px;
    padding-inline: 10px;
  }

  .taxonomic-issues-toolbar {
    gap: 6px;
  }

  .taxonomic-issues-toolbar select {
    width: auto;
    min-width: 0;
  }
}

.taxonomic-issues-table-wrap {
  max-height: 390px;
  overflow: auto;
  border-top: 1px solid #e6ebe7;
}

.taxonomic-issues-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #354039;
  font-size: 11px;
  text-align: left;
}

.taxonomic-issues-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #dde4df;
  color: #606b63;
  background: #f6f8f6;
  font-weight: 700;
  white-space: nowrap;
}

.taxonomic-issues-table td {
  padding: 10px;
  border-bottom: 1px solid #edf0ee;
  vertical-align: top;
}

.taxonomic-issues-table tbody tr:last-child td { border-bottom: 0; }

.taxonomic-issue-taxon { width: 20%; font-weight: 650; }
.taxonomic-issue-taxon span,
.taxonomic-issue-taxon small { display: block; }
.taxonomic-issue-taxon small { margin-top: 2px; color: #818a83; font-size: 10px; font-weight: 500; }
.taxonomic-issue-path { width: 36%; color: #59645c; line-height: 1.45; }
.taxonomic-issue-next-step { width: 26%; line-height: 1.4; }

.taxonomic-issue-badge {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid #d7ded9;
  border-radius: 999px;
  color: #4a554d;
  background: #f5f7f5;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.taxonomic-issue-badge[data-tone="review"] { border-color: #d9d4c8; color: #665e4e; background: #f8f6f1; }
.taxonomic-issue-badge[data-tone="conflict"] { border-color: #dfceca; color: #76524a; background: #faf5f3; }

.taxonomic-issues-empty {
  padding: 28px 14px !important;
  color: #79837c;
  text-align: center;
}

/* Data Steward selection details live alongside Explorer's right-side panel. */
#steward-taxon-detail {
  margin-top: 10px;
  padding-left: 16px;
  box-sizing: border-box;
  color: #263238;
  font-family: "Figtree", sans-serif;
}

#steward-taxon-detail[hidden] {
  display: none;
}

.steward-detail-heading,
.steward-path-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}

.steward-detail-heading {
  flex-wrap: wrap;
}

.steward-detail-kicker,
.steward-path-label,
.steward-detail-id {
  color: #6b7280;
  font-weight: 400;
}

.steward-detail-name,
.steward-path-current {
  color: #1f2937;
  font-weight: 600;
}

.steward-path-row {
  margin-top: 4px;
}

.steward-path-label {
  flex: 0 0 auto;
}

.steward-path {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
  gap: 4px;
  color: #374151;
}

.steward-path-separator {
  color: #9ca3af;
}

.steward-synonym-panel {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 4px;
  color: #1f2937;
  background: #f0fdf4;
}

.steward-synonym-panel--resolution {
  background: #fff7ed;
}

.steward-synonym-line {
  color: #1f2937;
}

.steward-synonym-line--accepted {
  font-size: 13px;
  line-height: 1.5;
}

.steward-synonym-line--accepted strong {
  color: #15803d;
  font-weight: 700;
}

.steward-synonym-line--accepted span {
  color: #15803d;
  font-weight: 600;
}

.steward-synonym-panel--resolution .steward-synonym-line--accepted strong {
  color: #9a3412;
}

.steward-synonym-entry {
  margin-top: 2px;
}

.steward-synonym-entry + .steward-synonym-entry {
  margin-top: 4px;
}

.steward-synonym-line--name {
  font-size: 13px;
  line-height: 1.5;
}

.steward-synonym-line--name strong {
  color: #15803d;
  font-weight: 700;
}

.steward-synonym-line--name em {
  color: #b45309;
  font-style: italic;
}

.steward-synonym-panel--resolution .steward-synonym-line--name strong {
  color: #9a3412;
}

.steward-synonym-line--meta {
  margin-top: 2px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.45;
}

.steward-synonym-line--meta strong {
  color: inherit;
  font-weight: 700;
}

.steward-synonym-panel--resolution .steward-synonym-line--meta {
  margin-top: 4px;
  color: #7c3a1e;
}

.steward-detail-group {
  margin: 10px 0 0;
}

.steward-detail-header {
  position: relative;
  min-height: 24px;
}

.steward-detail-title {
  display: block;
  padding: 2px 0;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.steward-detail-toggle {
  position: absolute;
  top: 50%;
  right: calc(100% + 5px);
  display: grid;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  place-items: center;
  background: transparent;
  color: #2f7d3b;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.steward-detail-toggle:hover,
.steward-detail-toggle:focus-visible {
  background: #e9f6eb;
  outline: none;
}

.steward-detail-toggle:focus-visible {
  box-shadow: 0 0 0 2px #43a047;
}

.steward-detail-toggle-icon {
  display: block;
  transition: transform 0.14s ease;
}

.steward-detail-toggle[aria-expanded="false"] .steward-detail-toggle-icon {
  transform: rotate(-90deg);
}

.steward-detail-content {
  padding: 0;
}

.steward-detail-card {
  min-width: 0;
}

/* Compact stream for the Data Steward recent-change queue. */
#summary-panel {
  margin-top: 8px !important;
  padding: 12px !important;
  border-color: #dce5de !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(25, 54, 35, 0.03);
}

.summary-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
}

.summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.summary-toggle:hover,
.summary-toggle:focus-visible {
  color: #2f7d3b;
  outline: none;
}

.summary-toggle:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 2px #43a047;
}

.summary-toggle-icon {
  color: #2f7d3b;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.14s ease;
}

.summary-toggle[aria-expanded="false"] .summary-toggle-icon {
  transform: rotate(-90deg);
}

.summary-collapse-meta {
  overflow: hidden;
  color: #7b8794;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-panel-content {
  margin-top: 10px;
}

.summary-panel-header,
.summary-pagination {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.summary-panel-title {
  color: #1f2937;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.summary-panel-subtitle {
  margin-top: 3px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.4;
}

.summary-range-select {
  flex: 0 0 auto;
  min-height: 29px;
  padding: 3px 24px 3px 8px;
  border: 1px solid #cbd5d0;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.summary-stat {
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.summary-stat--total { color: #475569; background: #f3f4f6; }
.summary-stat--new { color: #166534; background: #dcfce7; }
.summary-stat--modified { color: #92400e; background: #fef3c7; }

.summary-filter-btn {
  font: inherit;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease;
}

.summary-filter-btn:hover,
.summary-filter-btn:focus-visible {
  filter: brightness(0.97);
}

.summary-filter-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.summary-filter-btn[aria-pressed="true"] {
  transform: translateY(-1px);
}

.summary-kind.summary-filter-btn--count {
  width: auto;
  min-width: 52px;
  gap: 5px;
  padding: 0 9px;
}

.summary-filter-count {
  color: var(--summary-badge-fg);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.summary-pagination {
  align-items: center;
  margin-top: 10px;
  color: #8a96a6;
  font-size: 11px;
}

.summary-pagination-copy { min-width: 0; }

.summary-pagination-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.summary-pagination-actions button {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #cbd5d0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.summary-pagination-actions button:disabled {
  border-color: #d9dfdb;
  background: #f5f7f5;
  color: #a7b0aa;
  cursor: default;
}

.summary-items {
  max-height: 352px;
  margin-top: 7px;
  overflow-y: auto;
  border-top: 1px solid #e1e8e3;
}

.summary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border-bottom: 1px solid #e9eeea;
}

.summary-item:hover { background: #f8fbf8; }

.summary-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-height: 21px;
  border: 1px solid var(--summary-badge-border);
  border-radius: 999px;
  background: var(--summary-badge-bg);
  color: var(--summary-badge-fg);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.summary-item-main {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 9px;
  overflow: hidden;
}

.summary-taxon-name {
  flex: 0 1 auto;
  min-width: 60px;
  overflow: hidden;
  color: #243044;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item-details {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: baseline;
  min-width: 0;
  gap: 4px;
  overflow: hidden;
  color: #748091;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-group {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-change-count {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #fff5d6;
  color: #946200;
  font-size: 9px;
  font-weight: 700;
}

.summary-search-btn {
  display: inline-grid;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  place-items: center;
  background: transparent;
  color: #388d40;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.summary-search-btn:hover,
.summary-search-btn:focus-visible {
  border-color: #b9dfbd;
  background: #e9f8eb;
  color: #21772a;
  outline: none;
}

.summary-empty-state {
  padding: 20px 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.summary-empty-state--compact {
  padding: 10px 0 0;
  color: #7b8794;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .summary-panel-header { align-items: center; }
  .summary-panel-subtitle { display: none; }
  .summary-pagination-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .summary-item-main { gap: 6px; }
  .summary-item-details > span[aria-hidden="true"],
  .summary-item-details time { display: none; }
  .summary-group { max-width: 74px; }
}

body[data-app-view="about"] #stage,
body[data-app-view="about"] #sidebar {
  display: none !important;
}

body[data-app-view="about"] #layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-app-view="about"] #right-panel {
  max-width: 1100px;
  justify-self: center;
}

.about-panel {
  overflow: hidden;
  color: #344238;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #dce9df;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(23, 67, 35, 0.08);
}

.about-panel[hidden] {
  display: none;
}

.about-hero {
  position: relative;
  padding: clamp(30px, 5vw, 64px);
  overflow: hidden;
  background: linear-gradient(118deg, #edf7ed 0%, #f8fbf4 54%, #f3f6e9 100%);
}

.about-hero::after {
  position: absolute;
  z-index: 0;
  top: -84px;
  right: -56px;
  width: 280px;
  height: 280px;
  content: '';
  border: 38px solid rgba(117, 160, 101, 0.12);
  border-radius: 50%;
}

.about-identity,
.about-lede,
.about-primary-link {
  position: relative;
  z-index: 1;
}

.about-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.about-logo {
  width: 78px;
  height: auto;
  filter: drop-shadow(0 7px 9px rgba(49, 64, 45, 0.15));
}

.about-kicker {
  margin: 0 0 5px;
  color: #4e8057;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.about-hero h2,
.about-section h3 {
  margin: 0;
  color: #214a30;
  font-size: clamp(25px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.about-hero h2 {
  letter-spacing: 0.018em;
}

.about-lede {
  max-width: 760px;
  margin: 28px 0 24px;
  font-size: 17px;
  line-height: 1.7;
}

.about-citation {
  max-width: 760px;
  margin: -8px 0 24px;
  color: #5f7064;
  font-size: 13px;
  line-height: 1.62;
}

.about-citation a {
  color: #347342;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-primary-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  background: #347342;
  border-radius: 999px;
  padding: 11px 17px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(45, 103, 57, 0.2);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.about-primary-link:hover,
.about-primary-link:focus-visible {
  color: #ffffff;
  background: #245f32;
  box-shadow: 0 10px 20px rgba(45, 103, 57, 0.28);
  outline: none;
  transform: translateY(-1px);
}

.about-section {
  padding: clamp(28px, 4vw, 48px) clamp(30px, 5vw, 64px);
  border-top: 1px solid #e7eee7;
}

.about-section-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
}

.about-section h3 {
  font-size: clamp(22px, 3vw, 30px);
}

#neotoma-title,
#manual-title {
  letter-spacing: 0.018em;
}

.about-neotoma {
  display: grid;
  grid-template-columns: minmax(210px, 0.5fr) minmax(0, 1fr);
  column-gap: 46px;
}

.about-neotoma > p {
  grid-column: 2;
  max-width: 760px;
  margin: 0 0 13px;
  font-size: 15px;
  line-height: 1.68;
}

.about-community {
  padding-top: clamp(30px, 4vw, 48px);
  padding-bottom: clamp(30px, 4vw, 48px);
  background: #f5f9f4;
}

.about-community-banner {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 46px);
  color: #294a31;
  background: #e8f5e9;
  border: 1px solid #cfe5d2;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(27, 77, 40, 0.08);
}

.about-community-banner::after {
  position: absolute;
  right: -88px;
  bottom: -130px;
  width: 290px;
  height: 290px;
  content: '';
  border: 42px solid rgba(117, 160, 101, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.about-community-heading,
.about-community-grid,
.about-community-ecosystem,
.about-funding {
  position: relative;
  z-index: 1;
}

.about-community-heading .about-kicker {
  color: #347342;
}

.about-community-heading h3 {
  max-width: 620px;
  color: #214a30;
  font-size: clamp(24px, 3.5vw, 34px);
  letter-spacing: -0.025em;
}

.about-community-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.about-community-card {
  display: block;
  padding: 18px 19px;
  color: #214a30;
  background: #ffffff;
  border: 1px solid #c8dfcc;
  border-radius: 13px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.about-community-card:hover,
.about-community-card:focus-visible {
  color: #173d25;
  background: #f7fcf7;
  box-shadow: 0 10px 20px rgba(15, 55, 27, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.about-community-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}

.about-community-card p {
  margin: 9px 0 0;
  color: #5f7064;
  font-size: 13px;
  line-height: 1.55;
}

.about-community-card:hover p,
.about-community-card:focus-visible p {
  color: #5f7064;
}

.about-community-ecosystem {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 1.15fr;
  gap: 24px;
  margin-top: 28px;
  padding-top: 23px;
  border-top: 1px solid #c5dfc9;
}

.about-community-label {
  margin: 0 0 9px;
  color: #347342;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.about-community-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.about-community-link-list a,
.about-community-social-links a {
  color: #42624a;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.16s ease;
}

.about-community-link-list a:hover,
.about-community-link-list a:focus-visible,
.about-community-social-links a:hover,
.about-community-social-links a:focus-visible {
  color: #245f32;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-community-social-links {
  display: grid;
  gap: 8px;
}

.about-community-social-links a,
.about-community-social-links .about-social-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-community-social-links .about-social-placeholder {
  color: #607a66;
  font-size: 12px;
  line-height: 1.45;
}

.about-social-coming-soon {
  color: #7e9182;
  font-size: 11px;
  font-style: italic;
}

.about-social-logo {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 5px;
  background: #ffffff;
}

.about-funding {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid #c5dfc9;
}

.about-funding-label,
.about-funding-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.about-funding-logo {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.about-funding-label {
  color: #347342;
  font-weight: 800;
}

.about-funding-copy {
  color: #5f7064;
}

.about-funding-copy strong {
  color: #214a30;
}

.about-manual {
  background: #fcfdfb;
}

.about-manual-grid {
  display: grid;
  grid-template-columns: minmax(255px, 0.78fr) minmax(360px, 1.22fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.about-steps {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}

.about-step-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #ffffff;
  background: #4f8659;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.about-steps strong {
  display: block;
  margin-top: 3px;
  color: #284a31;
  font-size: 15px;
}

.about-steps p {
  margin: 5px 0 0;
  color: #647168;
  font-size: 14px;
  line-height: 1.55;
}

.about-guide-figure {
  margin: 0;
}

.about-guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dce8dd;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(32, 70, 41, 0.1);
}

.about-guide-figure figcaption {
  margin-top: 9px;
  color: #758179;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.about-explorer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(100%, 280px);
  margin: 16px auto 0;
  padding: 11px 16px;
  border: 1px solid #347342;
  border-radius: 999px;
  color: #347342;
  background: #ffffff;
  font-family: "Figtree", sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(45, 103, 57, 0.1);
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.about-explorer-link:hover,
.about-explorer-link:focus-visible {
  color: #ffffff;
  background: #347342;
  box-shadow: 0 9px 18px rgba(45, 103, 57, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.about-feedback {
  background:
    radial-gradient(circle at 88% 12%, rgba(120, 165, 105, 0.12), transparent 32%),
    #f8fbf7;
}

.about-feedback-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(22px, 4vw, 42px);
  align-items: stretch;
}

.about-feedback-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0;
}

.about-feedback-copy p {
  max-width: 610px;
  margin: 0;
  color: #57675c;
  font-size: 15px;
  line-height: 1.72;
}

.about-feedback-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  border: 1px solid #347342;
  border-radius: 999px;
  color: #ffffff;
  background: #347342;
  box-shadow: 0 8px 16px rgba(45, 103, 57, 0.2);
  font-family: "Figtree", sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.about-feedback-button:hover,
.about-feedback-button:focus-visible {
  background: #245f32;
  box-shadow: 0 11px 22px rgba(45, 103, 57, 0.28);
  outline: none;
  transform: translateY(-1px);
}

.taxonomy-feedback-note {
  padding: 22px 23px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #d8e6da;
  border-radius: 12px;
}

.taxonomy-feedback-note h4 {
  margin: 0;
  color: #284a31;
  font-size: 17px;
  line-height: 1.3;
}

.taxonomy-feedback-note p {
  margin: 10px 0 13px;
  color: #647168;
  font-size: 13px;
  line-height: 1.62;
}

.taxonomy-feedback-note a {
  color: #347342;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.taxonomy-feedback-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.taxonomy-feedback-note a:hover,
.taxonomy-feedback-note a:focus-visible {
  color: #245f32;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feedback-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(880px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  overflow: auto;
  color: #344238;
  background: #ffffff;
  border: 1px solid #d7e3d9;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(17, 48, 26, 0.28);
}

.feedback-dialog[open] {
  animation: feedback-dialog-in 0.2s ease-out;
}

.feedback-dialog::backdrop {
  background: rgba(21, 35, 27, 0.58);
  backdrop-filter: blur(3px);
}

.feedback-form {
  padding: clamp(24px, 5vw, 42px);
}

.feedback-dialog-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 2px solid #31533a;
}

.feedback-dialog h2 {
  margin: 0;
  color: #294335;
  font-size: clamp(27px, 5vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.feedback-dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  margin: -8px -8px 0 0;
  padding: 0 0 3px;
  color: #6d786f;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-family: "Figtree", sans-serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.feedback-dialog-close:hover,
.feedback-dialog-close:focus-visible {
  color: #214a30;
  background: #edf5ee;
  outline: none;
}

.feedback-dialog-description {
  max-width: 610px;
  margin: 20px 0 24px;
  color: #647168;
  font-size: 14px;
  line-height: 1.65;
}

.feedback-dialog-description a {
  color: #347342;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feedback-field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.feedback-field label {
  color: #344238;
  font-size: 14px;
  font-weight: 800;
}

.feedback-field label span {
  color: #7a867d;
  font-size: 12px;
  font-weight: 600;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  color: #26352b;
  background: #ffffff;
  border: 1.5px solid #cfd8d1;
  border-radius: 9px;
  font-family: "Figtree", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.feedback-field select {
  min-height: 44px;
}

.feedback-field textarea {
  min-height: 138px;
  resize: vertical;
}

.feedback-field input::placeholder,
.feedback-field textarea::placeholder {
  color: #929b94;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
  border-color: #4e8057;
  box-shadow: 0 0 0 3px rgba(78, 128, 87, 0.14);
  outline: none;
}

.feedback-file-control {
  display: flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 6px;
  color: #657169;
  background: #f9fbf9;
  border: 1.5px solid #cfd8d1;
  border-radius: 9px;
}

.feedback-file-control:focus-within {
  border-color: #4e8057;
  box-shadow: 0 0 0 3px rgba(78, 128, 87, 0.14);
}

.feedback-file-button {
  flex: 0 0 auto;
  margin-right: 10px;
  padding: 7px 11px;
  color: #31533a;
  background: #edf5ee;
  border: 1px solid #d1e0d3;
  border-radius: 6px;
  font-family: "Figtree", sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.feedback-file-button:hover {
  background: #e3efe5;
  border-color: #bcd1bf;
}

.feedback-file-button:focus-visible {
  outline: 2px solid #4e8057;
  outline-offset: 2px;
}

.feedback-file-name {
  min-width: 0;
  overflow: hidden;
  color: #657169;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-file-help {
  margin: 0;
  color: #7a867d;
  font-size: 11px;
  line-height: 1.5;
}

.feedback-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feedback-email-note {
  margin: 20px 0 0;
  padding: 11px 13px;
  color: #68756c;
  background: #f4f8f4;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.55;
}

.feedback-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.feedback-cancel-button,
.feedback-submit-button {
  min-height: 42px;
  padding: 10px 17px;
  border-radius: 9px;
  font-family: "Figtree", sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.feedback-cancel-button {
  color: #546159;
  background: #eef1ef;
  border: 1px solid #dce2dd;
}

.feedback-submit-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  background: #31533a;
  border: 1px solid #31533a;
}

.feedback-cancel-button:hover,
.feedback-cancel-button:focus-visible {
  color: #344238;
  background: #e3e8e4;
  outline: none;
}

.feedback-submit-button:hover,
.feedback-submit-button:focus-visible {
  background: #214a30;
  border-color: #214a30;
  outline: none;
}

@keyframes feedback-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-dialog[open] {
    animation: none;
  }
}

#layout {
  display: grid !important;
  grid-template-columns: clamp(360px, 28vw, 560px) minmax(640px, 1fr);
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

#right-panel {
  min-width: 0 !important;
  width: 100%;
  max-width: 560px;
  justify-self: stretch;
  grid-column: 1;
  grid-row: 1;
}

#stage {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
  grid-column: 2;
  grid-row: 1;
}

#chart {
  display: grid;
  place-items: center;
  overflow: visible;
}

#chart svg {
  max-width: 100%;
  height: auto;
  display: block;
}

#chart svg.focus-path-tree text.node-label {
  font-size: 13px;
  font-weight: 600;
}

#chart.focus-path-mode {
  display: block;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

#chart.focus-path-mode svg.focus-path-tree {
  max-width: none;
}

.visualizer-control-box {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  width: fit-content;
  max-width: calc(100% - 32px);
  padding: 10px 14px 10px 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(187, 247, 208, 0.95);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(22, 101, 52, 0.16);
  backdrop-filter: blur(10px);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.visualizer-control-box.is-collapsed {
  width: auto;
  padding: 6px;
}

.visualizer-control-box.is-collapsed .control-content {
  display: none;
}

.visualizer-control-box.is-dragging {
  cursor: grabbing;
  box-shadow: 0 18px 40px rgba(22, 101, 52, 0.22);
}

.visualizer-control-box button,
.visualizer-control-box .view-switch-group,
.visualizer-control-toggle {
  cursor: pointer;
}

.visualizer-control-toggle {
  position: absolute;
  top: 13px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #2e7d32;
  font-family: "Figtree", sans-serif;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
  padding: 0;
}

.visualizer-control-toggle::after,
.legend-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%) translateY(2px);
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(31, 41, 55, 0.92);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.visualizer-control-toggle:hover::after,
.visualizer-control-toggle:focus-visible::after,
.legend-toggle:hover::after,
.legend-toggle:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.visualizer-control-toggle:hover,
.visualizer-control-toggle:focus-visible,
.legend-toggle:hover,
.legend-toggle:focus-visible {
  color: #1b5e20;
  outline: none;
}

.visualizer-control-box.is-collapsed .visualizer-control-toggle {
  position: static;
  transform: translateY(-3px);
}

.visualizer-control-box input {
  cursor: auto;
  user-select: auto;
  touch-action: auto;
}

.visualizer-control-box .control-row {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.visualizer-control-box .rotate-zoom-row {
  display: grid;
  gap: 8px;
}

.visualizer-control-box .rotate-control {
  display: grid;
  grid-template-columns: max-content 190px 42px;
  gap: 6px;
  width: 100%;
  align-items: center;
  justify-content: start;
}

.visualizer-control-box .rotate-control label {
  font-size: 13px;
  letter-spacing: 0;
}

.visualizer-control-box .zoom-control {
  display: grid;
  grid-template-columns: 32px 32px auto auto auto;
  gap: 6px;
  width: 100%;
  align-items: center;
}

.visualizer-control-box #viewSwitchGroup {
  justify-self: start;
}

.visualizer-control-box #zoomValue,
.visualizer-control-box #rotateValue {
  align-self: center;
  font-size: 12px;
  min-width: 36px;
}

.visualizer-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 15;
  width: fit-content;
  max-width: calc(100% - 32px);
  padding: 8px 38px 8px 12px;
  background: rgba(249, 250, 251, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  font-size: 10px;
}

.visualizer-legend.is-collapsed {
  padding: 6px;
}

.visualizer-legend.is-collapsed .legend-items {
  display: none;
}

.legend-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(calc(-50% - 2px));
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #2e7d32;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.visualizer-legend.is-collapsed .legend-toggle {
  position: static;
  transform: none;
  translate: 0 -3px;
}

.visualizer-layer-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 14;
  width: min(620px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  color: #6b7280;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(229, 231, 235, 0.72);
  border-radius: 7px;
  padding: 7px 9px 7px 30px;
  backdrop-filter: blur(6px);
  box-sizing: border-box;
}

.layer-note-close {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #6b7280;
  font-family: "Figtree", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.layer-note-close:hover,
.layer-note-close:focus-visible {
  color: #1f2937;
  outline: none;
}

.legend-items {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 8px 18px;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-node {
  background: #202124;
}

.legend-collapsible {
  background: #7cafae;
}

.legend-line {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 1px;
}

.legend-search {
  background: #1976d2;
}

.legend-synonym {
  background: #f59e0b;
}

#sidebar {
  min-width: 0;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #eef2f7;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  padding: 12px;
  box-sizing: border-box;
}

#controls {
  --taxon-primary-control-width: 243px;
  --taxon-primary-control-height: 38px;
  --taxon-form-row-width: calc(85px + 8px + var(--taxon-primary-control-width));
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Control Row Styling */
.control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

/* First row: Rotate and Zoom */
.rotate-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rotate-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.rotate-control label {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  flex-shrink: 0;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

/* Second row: Taxon Group and Search */
.taxon-group-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 16px;
}

.taxon-group-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
  min-width: 0;
}

.taxon-group-section label {
  flex: 0 0 85px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-section {
  display: flex;
  align-items: center;
  width: var(--taxon-form-row-width);
  max-width: 100%;
  flex: 0 1 var(--taxon-form-row-width);
  min-width: 0;
  position: relative;
}

.search-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: var(--taxon-primary-control-height);
  box-sizing: border-box;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-field:focus-within {
  border-color: #43a047;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
  background: #ffffff;
}

/* Taxon Type segmented control */
.taxon-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 4px 16px;
}

.taxon-type-label {
  flex: 0 0 85px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  flex-shrink: 0;
}

.taxon-type-group {
  display: flex;
  background: #ffffff;
  border: 1.5px solid #43a047;
  border-radius: 8px;
  padding: 2px;
  gap: 0;
  width: var(--taxon-primary-control-width);
  height: var(--taxon-primary-control-height);
  box-sizing: border-box;
  flex: 0 1 var(--taxon-primary-control-width);
  min-width: 0;
}

.taxon-type-btn {
  flex: 1 1 0;
  background: transparent;
  color: #43a047;
  border: none;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Figtree", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.taxon-type-btn:first-child {
  border-radius: 6px 0 0 6px;
}

.taxon-type-btn:last-child {
  border-radius: 0 6px 6px 0;
}

.taxon-type-btn.active {
  background: #43a047;
  color: #ffffff;
}

.taxon-type-btn:not(.active):hover {
  background: #e8f5e9;
}

.taxon-type-btn.active:hover {
  background: #2e7d32;
}

/* Custom Select Styling */
.custom-select-wrapper {
  width: var(--taxon-primary-control-width);
  min-width: 0;
  flex: 0 1 var(--taxon-primary-control-width);
  max-width: 100%;
  position: relative;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  height: var(--taxon-primary-control-height);
  padding: 0 16px 0 10px;
  box-sizing: border-box;
  font-size: 14px;
  font-family: "Figtree", sans-serif;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  width: 100%;
  text-align: left;
}

.custom-select-trigger::after {
  content: '';
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger::after {
  transform: rotate(180deg);
}

.custom-select-trigger:hover {
  border-color: #43a047;
  background-color: #ffffff;
}

.custom-select-trigger:focus-visible,
.custom-options:focus-visible {
  outline: 3px solid rgba(67, 160, 71, 0.35);
  outline-offset: 2px;
}

.custom-select.open .custom-select-trigger {
  border-color: #43a047;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

.custom-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #f5f5f0;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.custom-select.open .custom-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: "Figtree", sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-option:hover {
  background-color: #e8f5e9;
}

.custom-option.keyboard-active {
  background-color: #c8edcb;
  box-shadow: inset 3px 0 0 #43a047;
}

.custom-option.selected {
  background-color: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

.custom-option.selected::before {
  content: '✓';
  font-weight: bold;
  color: #2e7d32;
}

/* Rotate and Zoom Specific Styles */
#rotate {
  height: 6px;
  accent-color: #43a047;
  min-width: 0;
  flex: 1 1 auto;
}

#zoomOut,
#zoomIn,
#zoomReset {
  background: linear-gradient(135deg, #43a047, #43a047);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 3px 8px rgba(47, 94, 215, 0.25);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: "Figtree", sans-serif;
}

#zoomOut,
#zoomIn {
  width: 32px;
  padding: 6px 0;
}

#zoomReset {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

/* View Switch Group - Segmented Control */
.view-switch-group {
  display: inline-flex;
  background: #ffffff;
  border: 1px solid #43a047;
  border-radius: 8px;
  padding: 2px;
  gap: 0;
}

.view-switch-btn {
  background: transparent;
  color: #43a047;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Figtree", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.view-switch-btn:first-child {
  border-radius: 6px 0 0 6px;
}

.view-switch-btn:last-child {
  border-radius: 0 6px 6px 0;
}

.view-switch-btn.active {
  background: #43a047;
  color: #ffffff;
}

.view-switch-btn:not(.active):hover {
  background: #e8f5e9;
  color: #43a047;
}

.view-switch-btn.active:hover {
  background: #2e7d32;
}

.search-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
}

.search-icon-btn img {
  width: 17px;
  height: 17px;
  display: block;
}

.search-clear-btn {
  width: 30px;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.search-field-actions {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  margin-right: 3px;
  flex: 0 0 auto;
}

.search-action-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: #d1d5db;
}

.search-icon-btn:hover {
  background: #e9f6eb;
}

.search-icon-btn:focus-visible {
  outline: 2px solid #43a047;
  outline-offset: -2px;
}

#zoomOut:hover,
#zoomIn:hover,
#zoomReset:hover {
  filter: brightness(1.05);
}

#zoomValue,
#rotateValue {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

#searchInput {
  /* The parent owns the 2px border. Stretch only through its inner content
     box so an autofill paint layer cannot cover that border. */
  align-self: stretch;
  height: auto;
  box-sizing: border-box;
  border: 0;
  border-radius: 6px 0 0 6px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  font-family: "Figtree", sans-serif;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

#searchInput::placeholder {
  font-weight: 600;
}

/* Keep browser form-history suggestions, but confine Chromium's autofill
   paint to the text area instead of flooding the composite search control. */
#searchInput:-webkit-autofill,
#searchInput:-webkit-autofill:hover,
#searchInput:-webkit-autofill:focus,
#searchInput:-webkit-autofill:active {
  -webkit-text-fill-color: #111827;
  -webkit-box-shadow: inset 0 0 0 20px #ffffff !important;
  box-shadow: inset 0 0 0 20px #ffffff !important;
  caret-color: #111827;
}

.taxon-autocomplete-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.16);
}

.taxon-autocomplete-option {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: #1f2937;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font-family: "Figtree", sans-serif;
}

.taxon-autocomplete-option:hover,
.taxon-autocomplete-option.active {
  background: #edf7ee;
}

.taxon-autocomplete-name {
  font-size: 14px;
  font-weight: 600;
}

.taxon-autocomplete-synonym {
  color: #6b7280;
  font-size: 12px;
}

#info {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 12px;
  box-sizing: border-box;
}

#info div {
  line-height: 1.5;
}

/*
 * Keep taxon names and their external-database badges inside the results card.
 * The badge group may contain many non-wrapping links, so both flex levels need
 * to wrap and surrender their intrinsic width to the panel.
 */
.taxon-path-terminal {
  display: flex;
  max-width: 100%;
  min-width: 0;
  margin-left: 12px;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.taxon-path-terminal-name {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.external-links-container {
  display: flex;
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  min-height: 20px;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Compare Panel ───────────────────────────────────────────────────────── */
.cmp-wrapper {
  font-family: "Figtree", sans-serif;
}

.cmp-heading {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.cmp-ancestor {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.cmp-ancestor-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #15803d;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cmp-ancestor-path {
  font-size: 12px;
  color: #166534;
  line-height: 1.6;
  word-wrap: break-word;
  margin-bottom: 6px;
}

.cmp-ancestor-lca {
  font-size: 13px;
  font-weight: 700;
  color: #15803d;
}

.cmp-arrow {
  opacity: 0.45;
  margin: 0 3px;
  font-size: 11px;
}

.cmp-diverge {
  font-size: 11px;
  color: #4b7c59;
  border-top: 1px solid #bbf7d0;
  padding-top: 6px;
  margin-top: 2px;
}

.cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.cmp-col {
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}

.cmp-col-q1 {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
}

.cmp-col-q2 {
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
}

.cmp-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}

.cmp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cmp-dot-q1 {
  background: #1d4ed8;
}

.cmp-dot-q2 {
  background: #6b21a8;
}

.cmp-col-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cmp-col-q1 .cmp-col-label {
  color: #1d4ed8;
}

.cmp-col-q2 .cmp-col-label {
  color: #6b21a8;
}

.cmp-item {
  font-size: 12px;
  padding: 1px 0 1px 6px;
  line-height: 1.5;
}

.cmp-col-q1 .cmp-item {
  color: #1e3a8a;
}

.cmp-col-q2 .cmp-item {
  color: #3b0764;
}

.cmp-item-empty {
  font-style: italic;
  color: #6b7280 !important;
}

.cmp-more {
  font-size: 10px;
  color: #6b7280;
  margin-top: 4px;
}

.cmp-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmp-match-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.cmp-match-q1 {
  background: #dbeafe;
  color: #1d4ed8;
}

.cmp-match-q2 {
  background: #ede9fe;
  color: #6b21a8;
}

.cmp-resolve-note {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  margin: -4px 0 10px;
}

.cmp-resolve-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cmp-resolve-card {
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.cmp-resolve-q1 {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
}

.cmp-resolve-q2 {
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
}

.cmp-resolve-label {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
}

.cmp-resolve-empty,
.cmp-resolve-path {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.45;
}

.cmp-resolve-selected {
  font-size: 13px;
  font-weight: 800;
  color: #15803d;
  margin-bottom: 3px;
}

.cmp-resolve-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.cmp-resolve-option {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  padding: 7px 8px;
  font-family: "Figtree", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cmp-resolve-option:hover,
.cmp-resolve-option:focus {
  border-color: #43a047;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
  outline: none;
}

.cmp-resolve-name {
  font-size: 12px;
  font-weight: 800;
  color: #1f2937;
}

/* SVG aesthetics */
svg path {
  transition: stroke-width 150ms ease, opacity 150ms ease;
}

/* Highlighted links should be lines only (no area fill) */
svg path.highlight {
  fill: none !important;
  stroke: #1976d2 !important;
  stroke-width: 2px;
}

/* Synonym highlighted links with different color */
svg path.highlight-synonym {
  fill: none !important;
  stroke: #f59e0b !important;
  stroke-width: 2px;
}

/* Text highlight styles */
svg text.highlight {
  fill: #1976d2 !important;
  font-weight: 600 !important;
}

svg text.highlight-synonym {
  fill: #f59e0b !important;
  font-weight: 600 !important;
  paint-order: stroke fill;
  stroke: white !important;
  stroke-width: 3px !important;
  stroke-linejoin: round !important;
}

/* Comparison mode: query 1 = blue, query 2 = orange */
svg path.highlight-q1 {
  fill: none !important;
  stroke: #1d4ed8 !important;
  stroke-width: 2.5px;
}

svg path.highlight-q2 {
  fill: none !important;
  stroke: #6b21a8 !important;
  stroke-width: 2.5px;
}

svg text.highlight-q1 {
  fill: #1d4ed8 !important;
  font-weight: 700 !important;
  paint-order: stroke fill;
  stroke: white !important;
  stroke-width: 3px !important;
  stroke-linejoin: round !important;
}

svg text.highlight-q2 {
  fill: #6b21a8 !important;
  font-weight: 700 !important;
  paint-order: stroke fill;
  stroke: white !important;
  stroke-width: 3px !important;
  stroke-linejoin: round !important;
}

/* In comparison mode: hide intermediate ancestor labels to reduce clutter;
   only the matched leaf labels (highlight-q1 / highlight-q2) remain visible */
svg.compare-mode.search-active g.node.match-path text:not(.toggle):not(.highlight-q1):not(.highlight-q2) {
  display: none !important;
}

/* Focus label styling */
.focus-label {
  fill: #0d47a1 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  pointer-events: none !important;
  paint-order: stroke fill;
  stroke: white;
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* Focused text styling (applied to existing text elements) */
.focused-text {
  fill: #0d47a1 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  paint-order: stroke fill;
  stroke: white;
  stroke-width: 3px;
  stroke-linejoin: round;
  display: block !important;
  /* Ensure it overrides culling */
}

/* Collapsible tree styling */
#chart svg g text {
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  fill: #202124;
}

#chart svg g circle {
  cursor: pointer;
  transition: fill 0.2s ease;
}

#chart svg g circle:hover {
  fill: #43a047 !important;
}

#chart svg path {
  transition: stroke 0.3s ease, stroke-opacity 0.3s ease;
}

@media (max-width: 1120px) {
  #layout {
    grid-template-columns: 1fr;
  }

  #right-panel,
  #stage {
    grid-column: auto;
    grid-row: auto;
  }

  #right-panel {
    max-width: none;
  }
}

@media (max-width: 720px) {
  body {
    padding: 10px;
  }

  #title-section {
    gap: 8px;
    align-items: flex-start;
    padding-right: 0;
  }

  #title-section h1 {
    padding-top: 5px;
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.15;
  }

  .view-nav-trigger {
    width: 34px;
    height: 34px;
  }

  .visualizer-control-box {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    padding: 8px;
  }

  .visualizer-control-box:not(.is-collapsed) {
    padding-right: 36px;
  }

  .visualizer-control-toggle {
    left: auto;
    right: 10px;
  }

  .visualizer-control-box.is-collapsed {
    width: auto;
    padding: 6px;
  }

  .visualizer-control-box .zoom-control {
    grid-template-columns: 30px 30px auto auto;
  }

  .visualizer-control-box #viewSwitchGroup {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .visualizer-legend {
    left: 10px;
    bottom: 10px;
    width: fit-content;
    max-width: calc(100% - 20px);
    padding: 8px 10px;
  }

  .visualizer-legend:not(.is-collapsed) {
    padding-right: 36px;
  }

  .visualizer-legend.is-collapsed {
    padding: 6px;
  }

  .visualizer-layer-note {
    right: 10px;
    bottom: 58px;
    max-width: calc(100% - 20px);
    font-size: 10px;
  }

  .about-hero,
  .about-section {
    padding: 28px 22px;
  }

  .about-logo {
    width: 58px;
  }

  .about-neotoma,
  .about-community-grid,
  .about-community-ecosystem,
  .about-manual-grid,
  .about-feedback-grid,
  .feedback-contact-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .about-neotoma > p {
    grid-column: auto;
  }

  .about-community-banner {
    padding: 24px 20px;
  }

  .feedback-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .feedback-form {
    padding: 24px 20px 20px;
  }

  .feedback-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
  }

  .feedback-submit-button {
    justify-content: center;
  }

  .about-funding {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
  }
}
