/* Assembled stylesheet. Edit the ordered parts listed in source/manifest.json, then run npm run build:gui from the repository root. */
/*
 * Source section 1/5: overview and initialization.
 * Assembles into styles/clademap.css.
 * Rules remain in their original cascade order; later sections may intentionally override these
 * declarations.
 */
/**
 * styles/clademap.css
 *
 * Contains accumulated application-specific layout and presentation rules for workspaces, action bars, menus, tree
 * settings and saved-view surfaces, with responsive overrides.
 */
/* CladeMap application identity and stable, compact tab rails. */
.brand .brand-logo,
.brand-logo {
  width: 128px !important;
  max-width: 128px !important;
  height: 24px !important;
  max-height: 24px !important;
  object-fit: contain;
  filter: none !important;
}
.about-logo {
  background: transparent !important;
  width: 220px !important;
  height: auto !important;
  border: 0 !important;
}
.about-logo img {
  display: block;
  width: 100%;
  height: auto;
}
body.workspace-all-closed .workspace-empty-state img {
  width: clamp(240px, 34vw, 560px) !important;
  max-height: 180px !important;
  object-fit: contain;
}
body .workspace-tabs.dual-workspace-tabs {
  min-width: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  align-items: stretch !important;
}
body.workspace-has-minimized-tabs.workspace-all-closed .dual-workspace-tabs {
  height: 30px !important;
  min-height: 30px !important;
}
body.workspace-has-minimized-tabs.workspace-all-closed .plot-shell {
  grid-template-rows: auto 30px minmax(0, 1fr) !important;
}
body .dual-workspace-tabs .workspace-tab-group {
  min-width: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 5px !important;
  gap: 3px !important;
  box-sizing: border-box !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
  background: var(--panel, #f5f6f8) !important;
}
body .workspace-tab-group .workspace-group-label {
  appearance: none;
  flex: 0 0 auto !important;
  order: 0 !important;
  height: 20px !important;
  min-height: 20px !important;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 3px;
  font-family: inherit;
  font-size: 9px !important;
  line-height: 1 !important;
  padding: 0 4px !important;
  white-space: nowrap;
  color: var(--muted, #6f7b91);
  cursor: pointer;
}
body .workspace-tab-group .workspace-tab-spacer {
  display: none !important;
}
.clademap-tab-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.clademap-tab-strip::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
body .dual-workspace-tabs .view-tab {
  position: relative !important;
  display: inline-flex;
  align-items: center !important;
  flex-direction: row !important;
  flex: 0 0 auto !important;
  height: 26px !important;
  min-height: 26px !important;
  max-width: 220px;
  padding: 0 9px !important;
  margin: 0 !important;
  gap: 5px !important;
  box-sizing: border-box !important;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
  clip-path: none !important;
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted, #5f6875) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
body .dual-workspace-tabs .view-tab :is(.ui-icon, .clademap-plugin-inline-icon) {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px !important;
}
body .dual-workspace-tabs .view-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body .dual-workspace-tabs .view-tab:hover {
  background: var(--soft, #e9edf1) !important;
  color: var(--text, #29313c) !important;
}
body .dual-workspace-tabs .view-tab.active {
  background: var(--panel, #fff) !important;
  color: var(--text, #29313c) !important;
  border-color: var(--line, #ccd2da) !important;
  box-shadow: 0 1px 2px #17212e12 !important;
  font-weight: 650 !important;
}
body .dual-workspace-tabs .view-tab::before,
body .dual-workspace-tabs .view-tab::after {
  display: none !important;
}
body .clademap-tab-scroll {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px !important;
  min-width: 22px !important;
  width: 22px !important;
  height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--line, #d5d9df) !important;
  border-radius: 4px !important;
  background: var(--panel, #fff) !important;
  color: var(--text, #39424f) !important;
  font: 20px/1 sans-serif !important;
  box-shadow: none !important;
}
body .clademap-tab-scroll[hidden] {
  display: none !important;
}
body .clademap-tab-scroll:disabled {
  opacity: 0.35;
  cursor: default;
}
body .clademap-tab-scroll:focus-visible,
body .clademap-tab-strip button:focus-visible {
  outline: 2px solid var(--accent, #5e6c80) !important;
  outline-offset: -2px;
}
/* Cluster analysis mode rail: keep the production tab-rail wrapper, but use
   the strong rounded-pill grammar requested for Clustering / Sample analysis /
   Phylogeny / Outbreak analysis. These selectors intentionally match the
   runtime-created .clademap-tab-strip so they cannot be flattened later. */
body .analysis-subtabs {
  height: 30px !important;
  min-height: 30px !important;
  overflow: hidden !important;
  gap: 3px !important;
  padding: 2px !important;
  border: 1px solid #d5deea !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
  box-sizing: border-box !important;
}
body .analysis-subtabs .clademap-tab-strip {
  gap: 5px !important;
  height: 100% !important;
  padding: 0 !important;
}
body .analysis-subtabs .clademap-tab-strip > button[data-analysis-subtab] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  height: 24px !important;
  min-height: 24px !important;
  border-radius: 999px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
  border: 1px solid #c9d4e1 !important;
  clip-path: none !important;
  transform: none !important;
  background: #f4f7fb !important;
  box-shadow: none !important;
  color: #3f5067 !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    box-shadow 0.14s ease !important;
}
body
  .analysis-subtabs
  .clademap-tab-strip
  > button[data-analysis-subtab]
  :is(.ui-icon, .clademap-plugin-inline-icon) {
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px !important;
  color: #53657c !important;
}
body .analysis-subtabs .clademap-tab-strip > button[data-analysis-subtab]:hover {
  background: #eaf1fb !important;
  border-color: #aebfd3 !important;
  color: #26415f !important;
}
body .analysis-subtabs .clademap-tab-strip > button[data-analysis-subtab].active,
body .analysis-subtabs .clademap-tab-strip > button[data-analysis-subtab][aria-selected='true'] {
  border-color: #1f50b7 !important;
  background: linear-gradient(180deg, #3476e8 0%, #2459c8 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.17),
    0 2px 6px rgba(36, 89, 200, 0.3) !important;
}
body
  .analysis-subtabs
  .clademap-tab-strip
  > button[data-analysis-subtab].active
  :is(.ui-icon, .clademap-plugin-inline-icon),
body
  .analysis-subtabs
  .clademap-tab-strip
  > button[data-analysis-subtab][aria-selected='true']
  :is(.ui-icon, .clademap-plugin-inline-icon) {
  color: #fff !important;
}
body .analysis-subtabs .clademap-tab-strip > button::before,
body .analysis-subtabs .clademap-tab-strip > button::after {
  display: none !important;
}
/* Keep the layout chooser above tab and analysis surfaces. */
.topbar:has(.split-view-popover:not(.hidden)) {
  z-index: 1000 !important;
  overflow: visible !important;
  position: relative;
}
.split-view-popover {
  z-index: 1100 !important;
}

/* Compact project data rows and predictable header geometry. */
#app .topbar {
  padding-left: 12px !important;
  padding-right: 12px !important;
}
#app .topbar .brand {
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 4px !important;
  gap: 8px !important;
  justify-content: flex-start !important;
}
#app .topbar .brand-logo {
  flex: 0 1 118px !important;
  width: 118px !important;
  max-width: 118px !important;
  height: 22px !important;
  max-height: 22px !important;
  object-position: center !important;
}
#app .project-database-bar {
  display: grid !important;
  grid-template-columns: 6px minmax(0, 1fr) auto !important;
  gap: 5px !important;
  align-items: center !important;
  padding: 5px 7px !important;
  min-height: 27px !important;
}
#app #projectDatabaseLabel {
  display: block !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
}
#app #projectLibraryCount {
  grid-column: 2 !important;
  grid-row: 2 !important;
  white-space: nowrap !important;
  font-size: 9px !important;
  line-height: 1.2 !important;
}
#app #projectDatabaseForgetBtn {
  grid-column: 3 !important;
  grid-row: 1 / 3 !important;
  width: auto !important;
  white-space: nowrap !important;
}
#app #projectDatabaseForgetBtn[hidden] {
  display: none !important;
}
#app .project-tree-file.compact-data-row {
  display: grid !important;
  grid-template-columns: 17px minmax(0, 1fr) fit-content(40%) 24px !important;
  gap: 5px !important;
  align-items: center !important;
  min-height: 27px !important;
  padding: 1px 3px !important;
  margin: 0 !important;
}
#app .compact-data-row > .ui-icon {
  width: 16px !important;
  height: 16px !important;
}
#app .compact-data-row .project-tree-file-name {
  display: block !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 10.5px !important;
  line-height: 1.3 !important;
}
#app .compact-data-row .project-data-more {
  grid-column: 4;
  grid-row: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  padding: 3px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
}
#app .compact-data-row .project-data-more:hover {
  background: #e8ecf1 !important;
}
.project-data-menu {
  z-index: 2000 !important;
  min-width: 190px;
}
.project-data-menu button {
  white-space: nowrap;
}
.project-input-files {
  margin: 0 3px 4px 25px;
  padding-left: 7px;
  border-left: 1px solid var(--border);
}
.project-input-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 3px;
  min-height: 22px;
}
.project-input-file-label {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.project-input-origin {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-style: italic;
}
.project-input-filename {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-input-file-more {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  padding: 3px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.project-input-file-more:hover,
.project-input-file-more:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}
.project-input-file-more .ui-icon { width: 13px; height: 13px; }
.clademap-paste-window {
  width: min(720px, 85vw);
  padding: 22px;
  border: 1px solid #ccd3dc;
  border-radius: 8px;
  background: #fff;
  color: #29313c;
}
.clademap-paste-window::backdrop {
  background: #25334866;
}
.clademap-paste-window label {
  display: grid;
  gap: 5px;
  margin: 12px 0;
}
.clademap-paste-window textarea {
  min-height: 260px;
  resize: vertical;
  font:
    12px Consolas,
    monospace;
}
.clademap-paste-window footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.clademap-paste-window [role='alert'] {
  color: #a22;
}
/* Interoperability controls may wrap without clipping their second line. */
#app #treeInteroperabilitySettings .tree-edit-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)) !important;
  gap: 5px !important;
}
#app #treeInteroperabilitySettings .tree-edit-grid button {
  height: auto !important;
  min-height: 32px !important;
  max-height: none !important;
  padding: 6px 8px !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  overflow: visible !important;
}
#app .unified-settings .settings-persistence-footer.unified-settings-reset {
  position: static !important;
  margin: 8px 3px 3px !important;
  flex-shrink: 0 !important;
}
#app #resetAllSettingsBtn {
  background: #edf0f3 !important;
  color: #465361 !important;
  border: 1px solid #cbd2da !important;
  height: auto !important;
  min-height: 28px !important;
  line-height: 1.3 !important;
  padding: 5px 8px !important;
}
/* Compact analysis inventory: status and actions keep their own stable columns. */
#projectTree .analysis-catalog-entry {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}
#projectTree .analysis-catalog-entry::before,
#projectTree .analysis-saved-files > li::before {
  display: none;
}
#projectTree .analysis-catalog-row {
  width: 100%;
}
#projectTree .project-tree-branches {
  padding-left: 7px;
  margin-left: 4px;
  padding-right: 0;
}
#projectTree .analysis-catalog-row {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  min-width: 0;
}
#projectTree .analysis-open {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 80px;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}
#projectTree .analysis-open > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#projectTree .analysis-open > svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
}
#projectTree .analysis-indicators {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
#projectTree .analysis-file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    600 9px/15px system-ui,
    sans-serif;
  border: 1px solid var(--border, #ccd3de);
  border-radius: 3px;
  padding: 0 3px;
  color: var(--muted, #64748b);
  flex: none;
}
#projectTree .analysis-ran {
  color: #28826d;
  display: inline-flex;
}
/*
 * Source section 2/5: project tree analysis ran svg.
 * Assembles into styles/clademap.css.
 * Rules remain in their original cascade order; later sections may intentionally override these
 * declarations.
 */
#projectTree .analysis-ran svg {
  width: 12px;
  height: 12px;
}
#projectTree .analysis-result-actions {
  display: flex;
  flex: none;
  gap: 0;
}
#projectTree .analysis-result-actions button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 24px;
  padding: 3px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--muted, #64748b);
}
#projectTree .analysis-result-actions button:hover:not(:disabled) {
  background: var(--hover, #edf1f5);
  color: var(--text, #1e293b);
}
#projectTree .analysis-result-actions button:disabled {
  opacity: 0.3;
  cursor: default;
}
#projectTree .analysis-result-actions svg {
  width: 14px;
  height: 14px;
}
#projectTree .analysis-saved-files {
  padding: 0 0 3px 20px;
  margin: 0;
  list-style: none;
}
#projectTree .analysis-saved-files button {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  background: transparent;
  border: 0;
  color: var(--muted, #64748b);
  text-align: left;
}
#projectTree .analysis-saved-files button > span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analysis-folder-dialog {
  width: min(520px, 85vw);
  max-height: 80vh;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 20px;
}
.analysis-folder-dialog > button {
  display: block;
  margin: 6px 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Compact desktop menus with direct settings targets. */
body .menu-dropdown.compact-app-menu {
  width: 202px !important;
  min-width: 202px !important;
  padding: 3px !important;
  border-radius: 5px !important;
}
body .menu-dropdown.compact-app-menu .menu-submenu {
  min-width: 194px !important;
  max-width: 268px !important;
  padding: 3px !important;
  border-radius: 5px !important;
}
body .menu-dropdown.compact-app-menu button,
body .menu-dropdown.compact-app-menu .menu-submenu button {
  min-height: 23px !important;
  height: auto !important;
  padding: 3px 6px !important;
  gap: 10px !important;
  border-radius: 3px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}
body .menu-dropdown.compact-app-menu .menu-separator {
  margin: 2px 3px !important;
}
body .menu-dropdown.compact-app-menu .menu-arrow-icon {
  width: 11px !important;
  height: 11px !important;
}
body .settings-direct-menu {
  width: 218px !important;
  min-width: 218px !important;
}
body .settings-direct-menu > button,
body .settings-direct-menu #additionalPluginSettingsMenu > button {
  justify-content: flex-start !important;
}
body .settings-direct-menu > button > .ui-icon,
body .settings-direct-menu #additionalPluginSettingsMenu > button > .ui-icon {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px !important;
}
body .settings-direct-menu #additionalPluginSettingsMenu:empty {
  display: none !important;
}

/* Tree Settings: single-row control list and view-aware scope. */
#app #treeSettingsScope.tree-settings-scope {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
}
#app #treeSettingsScope .tree-settings-scope-btn {
  width: 100% !important;
  height: auto !important;
  min-height: 25px !important;
  padding: 4px 7px !important;
  border-radius: 5px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 9.3px !important;
  line-height: 1.2 !important;
  white-space: normal !important;
}
#app #tab-appearance.tree-settings .tree-settings-context-hidden {
  display: none !important;
}
#app #tab-appearance.tree-settings .tree-settings-context-block {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 3px !important;
  min-width: 0 !important;
}

/* Every ordinary Tree setting occupies one vertical row: label left, control right. */
#app
  #tab-appearance.tree-settings
  :is(
    .settings-compact-body,
    .settings-module-body,
    .settings-subsection > div,
    .nested-setting > .settings-module-body,
    .metadata-field-body
  ) {
  grid-template-columns: 1fr !important;
}
#app
  #tab-appearance.tree-settings
  :is(
    .settings-inline-grid,
    .tree-annotation-inline,
    .position-controls > div,
    .position-grid,
    .tree-autocollapse,
    .tree-column-extra
  ) {
  grid-template-columns: 1fr !important;
}
#app
  #tab-appearance.tree-settings
  :is(
    .settings-compact-body,
    .settings-module-body,
    .settings-subsection > div,
    .nested-setting > .settings-module-body,
    .settings-inline-grid,
    .tree-annotation-inline,
    .position-controls > div,
    .position-grid,
    .tree-autocollapse,
    .tree-column-extra,
    .tree-settings-context-block
  )
  > label:not(.check-row),
#app #tab-appearance.tree-settings .metadata-field-block > label:not(.check-row),
#app #tab-appearance.tree-settings .field-order-row > label:not(.check-row) {
  display: grid !important;
  grid-template-columns: minmax(104px, 42%) minmax(0, 58%) !important;
  align-items: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 29px !important;
  padding: 2px 3px !important;
  margin: 0 !important;
}
#app
  #tab-appearance.tree-settings
  :is(
    .settings-compact-body,
    .settings-module-body,
    .settings-subsection > div,
    .nested-setting > .settings-module-body,
    .settings-inline-grid,
    .tree-annotation-inline,
    .position-controls > div,
    .position-grid,
    .tree-autocollapse,
    .tree-column-extra,
    .tree-settings-context-block
  )
  > label:not(.check-row)
  > span:first-child,
#app #tab-appearance.tree-settings .metadata-field-block > label:not(.check-row) > span:first-child,
#app #tab-appearance.tree-settings .field-order-row > label:not(.check-row) > span:first-child {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  line-height: 1.2 !important;
}
#app
  #tab-appearance.tree-settings
  :is(
    .settings-compact-body,
    .settings-module-body,
    .settings-subsection > div,
    .nested-setting > .settings-module-body,
    .settings-inline-grid,
    .tree-annotation-inline,
    .position-controls > div,
    .position-grid,
    .tree-autocollapse,
    .tree-column-extra,
    .tree-settings-context-block
  )
  > label:not(.check-row)
  > :is(input, select, textarea, .metadata-scale-control),
#app
  #tab-appearance.tree-settings
  .metadata-field-block
  > label:not(.check-row)
  > :is(input, select, textarea) {
  min-width: 0 !important;
  width: 100% !important;
}

#app
  #tab-appearance.tree-settings
  label:not(.check-row):has(> input:not([type='checkbox']), > select, > textarea, > .metadata-scale-control) {
  display: grid !important;
  grid-template-columns: minmax(104px, 42%) minmax(0, 58%) !important;
  align-items: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 29px !important;
  margin: 0 !important;
}
#app
  #tab-appearance.tree-settings
  label:not(.check-row):has(> input:not([type='checkbox']), > select, > textarea, > .metadata-scale-control)
  > span:first-child {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  line-height: 1.2 !important;
}
#app
  #tab-appearance.tree-settings
  label:not(.check-row):has(> input:not([type='checkbox']), > select, > textarea, > .metadata-scale-control)
  > :is(input, select, textarea, .metadata-scale-control) {
  min-width: 0 !important;
  width: 100% !important;
}

/* Action boxes remain a true three-column grid. Narrow panels grow rows vertically instead of hiding button text. */
#app #tab-appearance.tree-settings .button-grid.tree-edit-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
  align-items: stretch !important;
}
#app #tab-appearance.tree-settings .button-grid.tree-edit-grid button {
  height: auto !important;
  min-height: 36px !important;
  max-height: none !important;
  padding: 5px 5px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}
@container (max-width:300px) {
  #app
    #tab-appearance.tree-settings
    :is(
      .settings-compact-body,
      .settings-module-body,
      .settings-subsection > div,
      .nested-setting > .settings-module-body,
      .settings-inline-grid,
      .tree-annotation-inline,
      .position-controls > div,
      .position-grid,
      .tree-autocollapse,
      .tree-column-extra,
      .tree-settings-context-block
    )
    > label:not(.check-row),
  #app #tab-appearance.tree-settings .metadata-field-block > label:not(.check-row),
  #app #tab-appearance.tree-settings .field-order-row > label:not(.check-row) {
    grid-template-columns: minmax(88px, 43%) minmax(0, 57%) !important;
    gap: 5px !important;
  }
  #app #tab-appearance.tree-settings .button-grid.tree-edit-grid button {
    min-height: 44px !important;
    padding: 5px 3px !important;
    font-size: 8.5px !important;
  }
}

/* Tree Settings readability pass: larger text with tighter vertical rhythm.
   Scope filtering remains active, but the redundant Common + Tree/Compact label is removed. */
#app #tab-appearance.tree-settings {
  font-size: 11.5px !important;
  line-height: 1.08 !important;
}
#app #tab-appearance.tree-settings .settings-page-titlebar.compact-settings-title {
  min-height: 27px !important;
  padding: 2px 5px !important;
  margin: 0 1px 1px !important;
}
#app #tab-appearance.tree-settings .compact-settings-title strong {
  font-size: 12.5px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings .compact-settings-title small {
  font-size: 10.5px !important;
  line-height: 1.05 !important;
}
#app #treeSettingsNavigator.tree-settings-navigator {
  margin: 0 1px 1px !important;
  padding: 2px !important;
  gap: 2px !important;
}
#app #treeSettingsNavigator .tree-settings-search,
#app #treeSettingsNavigator .tree-settings-section-nav {
  height: 24px !important;
  min-height: 24px !important;
  padding: 1px 5px !important;
  font-size: 11px !important;
  line-height: 1.05 !important;
}
#app #treeSettingsScope {
  margin: 0 !important;
  padding: 0 !important;
  gap: 2px !important;
}
#app #treeSettingsScope .tree-settings-scope-btn {
  height: 22px !important;
  min-height: 22px !important;
  padding: 1px 7px !important;
  font-size: 10.8px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings .settings-compact-section,
#app #tab-appearance.tree-settings .settings-module,
#app #tab-appearance.tree-settings .tree-metadata-field-navigator,
#app #tab-appearance.tree-settings .metadata-field-sections,
#app #tab-appearance.tree-settings .metadata-field-reset-row {
  margin: 1px !important;
}
#app #tab-appearance.tree-settings .settings-compact-section > summary {
  min-height: 24px !important;
  padding: 3px 20px 3px 19px !important;
  font-size: 11.8px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings .settings-compact-body,
#app #tab-appearance.tree-settings .settings-module-body {
  gap: 1px !important;
  padding: 2px 4px 3px !important;
}
#app #tab-appearance.tree-settings .settings-compact-body > label:not(.check-row),
#app #tab-appearance.tree-settings .settings-subsection > div > label:not(.check-row),
#app #tab-appearance.tree-settings .nested-setting > .settings-module-body > label:not(.check-row) {
  min-height: 28px !important;
  padding: 0 2px !important;
  margin: 0 !important;
  gap: 4px !important;
}
#app #tab-appearance.tree-settings label > span:first-child,
#app #tab-appearance.tree-settings label > strong:first-child,
#app #tab-appearance.tree-settings .settings-compact-body > label:not(.check-row) > span:first-child,
#app #tab-appearance.tree-settings .settings-subsection > div > label:not(.check-row) > span:first-child,
#app
  #tab-appearance.tree-settings
  .nested-setting
  > .settings-module-body
  > label:not(.check-row)
  > span:first-child {
  font-size: 11.2px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings input[type='text'],
#app #tab-appearance.tree-settings input[type='search'],
#app #tab-appearance.tree-settings input[type='number'],
#app #tab-appearance.tree-settings select {
  height: 24px !important;
  min-height: 24px !important;
  padding: 1px 4px !important;
  font-size: 11.2px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings textarea {
  min-height: 42px !important;
  padding: 4px 5px !important;
  font-size: 11.2px !important;
  line-height: 1.15 !important;
}
#app #tab-appearance.tree-settings input[type='color'] {
  height: 22px !important;
  min-height: 22px !important;
}
#app #tab-appearance.tree-settings input[type='checkbox'] {
  width: 13px !important;
  height: 13px !important;
}
#app #tab-appearance.tree-settings .check-row {
  min-height: 20px !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 2px !important;
}
#app #tab-appearance.tree-settings .check-row > span,
#app #tab-appearance.tree-settings .check-row > strong {
  font-size: 11.2px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings button,
#app #tab-appearance.tree-settings .mini-btn,
#app #tab-appearance.tree-settings .wide-btn {
  min-height: 22px !important;
  padding: 2px 5px !important;
  font-size: 10.8px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings .settings-module-head,
#app #tab-appearance.tree-settings .nested-setting-head {
  min-height: 24px !important;
  padding: 2px 5px !important;
}
#app #tab-appearance.tree-settings .settings-module-head label,
#app #tab-appearance.tree-settings .nested-setting-head label,
#app #tab-appearance.tree-settings .settings-module-head strong {
  font-size: 11.5px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings .setting-detail-toggle {
  min-height: 19px !important;
  height: 19px !important;
  padding: 1px 5px !important;
  font-size: 10px !important;
}
#app #tab-appearance.tree-settings .settings-subsection-label {
  margin: 0 !important;
  padding-top: 1px !important;
  font-size: 10.5px !important;
  line-height: 1.05 !important;
}
#app #tab-appearance.tree-settings .selection-card,
#app #tab-appearance.tree-settings .setting-note,
#app #tab-appearance.tree-settings .concise-note,
#app #tab-appearance.tree-settings .empty-mini,
#app #tab-appearance.tree-settings .performance-empty {
  padding: 2px 4px !important;
  margin: 1px 0 !important;
  font-size: 10.5px !important;
  line-height: 1.1 !important;
}
#app #tab-appearance.tree-settings .tree-edit-grid,
#app #tab-appearance.tree-settings .button-grid {
  gap: 2px !important;
}
#app #tab-appearance.tree-settings .tree-edit-grid button,
#app #tab-appearance.tree-settings .button-grid button {
  min-height: 28px !important;
  height: auto !important;
  max-height: none !important;
  padding: 3px 5px !important;
  white-space: normal !important;
  overflow: visible !important;
  line-height: 1.08 !important;
}

/* Tree Settings UX refinement: larger type, tighter rhythm, clear active target, expandable subtitle. */
/*
 * Source section 3/5: app tab appearance tree settings.
 * Assembles into styles/clademap.css.
 * Rules remain in their original cascade order; later sections may intentionally override these
 * declarations.
 */
#app #tab-appearance.tree-settings {
  font-size: 12.4px !important;
  line-height: 1.03 !important;
}
#app #tab-appearance.tree-settings .compact-settings-title strong {
  font-size: 13.4px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings .compact-settings-title small {
  font-size: 11.4px !important;
  line-height: 1 !important;
}
#app #treeSettingsNavigator.tree-settings-navigator {
  margin: 0 !important;
  padding: 1px 2px !important;
  gap: 1px !important;
}
#app #treeSettingsNavigator .tree-settings-search,
#app #treeSettingsNavigator .tree-settings-section-nav {
  height: 23px !important;
  min-height: 23px !important;
  padding: 1px 5px !important;
  font-size: 11.8px !important;
  line-height: 1 !important;
}
#app #treeSettingsScope {
  gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
}
#app #treeSettingsScope .tree-settings-scope-btn {
  height: 23px !important;
  min-height: 23px !important;
  padding: 1px 8px !important;
  font-size: 11.7px !important;
  line-height: 1 !important;
  font-weight: 650 !important;
  background: #f7f9fc !important;
  border-color: #cfd7e2 !important;
  color: #526277 !important;
}
/* View-selector states are defined once in the r65 selector block below. */
#app #tab-appearance.tree-settings .settings-compact-section,
#app #tab-appearance.tree-settings .settings-module,
#app #tab-appearance.tree-settings .tree-metadata-field-navigator,
#app #tab-appearance.tree-settings .metadata-field-sections,
#app #tab-appearance.tree-settings .metadata-field-reset-row {
  margin: 0 1px !important;
}
#app #tab-appearance.tree-settings .settings-compact-section > summary {
  min-height: 23px !important;
  padding: 2px 20px 2px 19px !important;
  font-size: 12.7px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings .settings-compact-body,
#app #tab-appearance.tree-settings .settings-module-body {
  gap: 0 !important;
  padding: 1px 4px 2px !important;
}
#app #tab-appearance.tree-settings .settings-compact-body > label:not(.check-row),
#app #tab-appearance.tree-settings .settings-subsection > div > label:not(.check-row),
#app #tab-appearance.tree-settings .nested-setting > .settings-module-body > label:not(.check-row) {
  min-height: 25px !important;
  padding: 0 2px !important;
  margin: 0 !important;
  gap: 4px !important;
}
#app #tab-appearance.tree-settings label > span:first-child,
#app #tab-appearance.tree-settings label > strong:first-child,
#app #tab-appearance.tree-settings .settings-compact-body > label:not(.check-row) > span:first-child,
#app #tab-appearance.tree-settings .settings-subsection > div > label:not(.check-row) > span:first-child,
#app
  #tab-appearance.tree-settings
  .nested-setting
  > .settings-module-body
  > label:not(.check-row)
  > span:first-child {
  font-size: 12px !important;
  line-height: 1.02 !important;
}
#app #tab-appearance.tree-settings input[type='text'],
#app #tab-appearance.tree-settings input[type='search'],
#app #tab-appearance.tree-settings input[type='number'],
#app #tab-appearance.tree-settings select {
  height: 23px !important;
  min-height: 23px !important;
  padding: 1px 4px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings textarea {
  font-size: 12px !important;
  line-height: 1.18 !important;
}
#app #tab-appearance.tree-settings .figure-subtitle-setting textarea {
  height: 58px;
  min-height: 42px !important;
  max-height: none !important;
  resize: vertical !important;
  overflow: auto !important;
  padding: 4px 5px !important;
}
#app #tab-appearance.tree-settings input[type='color'] {
  height: 21px !important;
  min-height: 21px !important;
}
#app #tab-appearance.tree-settings input[type='checkbox'] {
  width: 13px !important;
  height: 13px !important;
}
#app #tab-appearance.tree-settings .check-row {
  min-height: 18px !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 2px !important;
}
#app #tab-appearance.tree-settings .check-row > span,
#app #tab-appearance.tree-settings .check-row > strong {
  font-size: 12px !important;
  line-height: 1.02 !important;
}
#app #tab-appearance.tree-settings button,
#app #tab-appearance.tree-settings .mini-btn,
#app #tab-appearance.tree-settings .wide-btn {
  min-height: 22px !important;
  padding: 2px 5px !important;
  font-size: 11.5px !important;
  line-height: 1.02 !important;
}
#app #tab-appearance.tree-settings .settings-module-head,
#app #tab-appearance.tree-settings .nested-setting-head {
  min-height: 23px !important;
  padding: 1px 5px !important;
}
#app #tab-appearance.tree-settings .settings-module-head label,
#app #tab-appearance.tree-settings .nested-setting-head label,
#app #tab-appearance.tree-settings .settings-module-head strong {
  font-size: 12.3px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings .setting-detail-toggle {
  min-height: 18px !important;
  height: 18px !important;
  padding: 1px 5px !important;
  font-size: 10.8px !important;
}
#app #tab-appearance.tree-settings .settings-subsection-label {
  margin: 0 !important;
  padding-top: 1px !important;
  font-size: 11.3px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings .selection-card,
#app #tab-appearance.tree-settings .setting-note,
#app #tab-appearance.tree-settings .concise-note,
#app #tab-appearance.tree-settings .empty-mini,
#app #tab-appearance.tree-settings .performance-empty {
  padding: 1px 4px !important;
  margin: 0 !important;
  font-size: 11.2px !important;
  line-height: 1.06 !important;
}
#app #tab-appearance.tree-settings .tree-edit-grid,
#app #tab-appearance.tree-settings .button-grid {
  gap: 2px !important;
}
#app #tab-appearance.tree-settings .tree-edit-grid button,
#app #tab-appearance.tree-settings .button-grid button {
  min-height: 27px !important;
  height: auto !important;
  max-height: none !important;
  padding: 3px 4px !important;
  white-space: normal !important;
  overflow: visible !important;
  line-height: 1.05 !important;
  font-weight: 600 !important;
}

/* Metadata highlighting stays compact in its closed state. */
#app #tab-appearance.tree-settings #metadataHighlightFields {
  gap: 3px !important;
  padding: 4px !important;
}
#app #tab-appearance.tree-settings #metadataValueDropdown > summary {
  min-height: 25px !important;
  padding: 2px 5px !important;
  font-size: 11.8px !important;
  line-height: 1 !important;
}
#app #tab-appearance.tree-settings #metadataValueOptions {
  padding: 3px !important;
}
#app #tab-appearance.tree-settings #metadataValueOptions .multi-select-option {
  padding: 3px 4px !important;
  font-size: 11.5px !important;
}

/* Tree Settings polish: explicit export scopes and clearer editing subsections. */
#app #treeSettingsScope .tree-settings-scope-btn.active,
#app #treeSettingsScope .tree-settings-scope-btn[aria-pressed='true'] {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}
#app #tab-appearance.tree-settings #treeEditingSettings .editing-group-label,
#app #tab-appearance.tree-settings #treeHighlightsSettings .editing-group-label {
  margin: 5px 0 3px !important;
  padding-top: 0 !important;
}
#app #tab-appearance.tree-settings .export-report-options {
  padding: 0 !important;
}
#app #tab-appearance.tree-settings .export-report-options > .settings-compact-body {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
}

/* Cluster-analysis UI polish: Tree settings now use the same relaxed vertical
   rhythm as Cluster analysis, while preserving Tree-specific structure. */
#app #tab-appearance.tree-settings .settings-page-titlebar.compact-settings-title {
  min-height: 31px !important;
  padding: 5px 7px !important;
  margin: 0 4px 4px !important;
}
#app #treeSettingsNavigator.tree-settings-navigator {
  margin: 0 4px 5px !important;
  padding: 5px !important;
  gap: 4px !important;
}
#app #treeSettingsNavigator .tree-settings-search,
#app #treeSettingsNavigator .tree-settings-section-nav {
  height: 24px !important;
  min-height: 24px !important;
  padding: 2px 6px !important;
}
#app #tab-appearance.tree-settings .settings-compact-section,
#app #tab-appearance.tree-settings .settings-module,
#app #tab-appearance.tree-settings .tree-metadata-field-navigator,
#app #tab-appearance.tree-settings .metadata-field-sections,
#app #tab-appearance.tree-settings .metadata-field-reset-row {
  margin: 3px 4px !important;
}
#app #tab-appearance.tree-settings .settings-compact-section > summary {
  min-height: 27px !important;
  padding: 5px 23px 5px 21px !important;
}
#app #tab-appearance.tree-settings .settings-compact-body,
#app #tab-appearance.tree-settings .settings-module-body {
  gap: 4px !important;
  padding: 5px 7px !important;
}
#app #tab-appearance.tree-settings .settings-compact-body > label:not(.check-row),
#app #tab-appearance.tree-settings .settings-module-body > label:not(.check-row),
#app #tab-appearance.tree-settings .settings-subsection > div > label:not(.check-row),
#app #tab-appearance.tree-settings .nested-setting > .settings-module-body > label:not(.check-row),
#app #tab-appearance.tree-settings .metadata-field-block > label:not(.check-row) {
  min-height: 27px !important;
  gap: 6px !important;
  padding: 1px 2px !important;
}
#app #tab-appearance.tree-settings input[type='text'],
#app #tab-appearance.tree-settings input[type='search'],
#app #tab-appearance.tree-settings input[type='number'],
#app #tab-appearance.tree-settings select {
  height: 25px !important;
  min-height: 25px !important;
  padding: 2px 6px !important;
}
#app #tab-appearance.tree-settings .check-row {
  min-height: 23px !important;
  gap: 6px !important;
  padding: 1px 2px !important;
}
#app #tab-appearance.tree-settings button,
#app #tab-appearance.tree-settings .mini-btn,
#app #tab-appearance.tree-settings .wide-btn {
  min-height: 25px !important;
  padding: 3px 7px !important;
}
#app #tab-appearance.tree-settings .settings-module-head,
#app #tab-appearance.tree-settings .nested-setting-head {
  min-height: 27px !important;
  padding: 4px 7px !important;
}
#app #tab-appearance.tree-settings .selection-card,
#app #tab-appearance.tree-settings .setting-note,
#app #tab-appearance.tree-settings .concise-note,
#app #tab-appearance.tree-settings .empty-mini,
#app #tab-appearance.tree-settings .performance-empty {
  padding: 5px 6px !important;
  margin: 1px 0 !important;
  line-height: 1.2 !important;
}
#app #tab-appearance.tree-settings .settings-persistence-footer {
  margin: 4px !important;
  padding: 5px !important;
}

/* r65 — Tree settings section title typography must match Map settings exactly.
   This final cascade intentionally follows the dense Tree rhythm overrides. */
#app #tab-appearance.tree-settings .settings-compact-section > summary,
#app #tab-appearance.tree-settings .settings-subsection > summary,
#app #tab-appearance.tree-settings .settings-module-head label,
#app #tab-appearance.tree-settings .settings-module-head strong,
#app #tab-appearance.tree-settings .nested-setting-head label,
#app #tab-appearance.tree-settings .nested-setting-head strong {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  color: #304158 !important;
}

/* Metadata presentation uses one neutral surface for Header, Tree column and
   Compact track.  No semantic tint is assigned to one field subsection. */
#app #tab-appearance.tree-settings .metadata-header-block,
#app #tab-appearance.tree-settings .metadata-track-field-block,
#app #tab-appearance.tree-settings .metadata-field-block {
  background: #fbfcfd !important;
  border-color: #e2e7ee !important;
}
#app #tab-appearance.tree-settings .metadata-header-block > .metadata-field-block-title,
#app #tab-appearance.tree-settings .metadata-track-field-block > .metadata-field-block-title,
#app #tab-appearance.tree-settings .metadata-field-block > .metadata-field-block-title {
  color: #637085 !important;
  border-bottom-color: #e9edf2 !important;
}

/* Workspace tabs: Chrome-style close control + drag reorder. */
body .dual-workspace-tabs .clademap-workspace-tab-shell {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  max-width: 246px !important;
  height: 26px !important;
  border-radius: 6px !important;
  cursor: grab !important;
  user-select: none !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell[hidden] {
  display: none !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell.is-dragging {
  opacity: 0.48 !important;
  cursor: grabbing !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell > .view-tab {
  min-width: 0 !important;
  max-width: 210px !important;
  padding-right: 5px !important;
  cursor: grab !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell.is-dragging > .view-tab {
  cursor: grabbing !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 4px 0 -2px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #718096 !important;
  display: grid !important;
  place-items: center !important;
  font:
    600 15px/1 Arial,
    sans-serif !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell.active > .clademap-workspace-tab-close {
  color: #42536a !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close:hover {
  background: #dfe7f1 !important;
  color: #172b45 !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close:focus-visible {
  outline: 2px solid #4d7fd6 !important;
  outline-offset: 1px !important;
}
body
  .dual-workspace-tabs
  .clademap-workspace-tab-shell.workspace-tab-minimized
  > .clademap-workspace-tab-close {
  opacity: 0.7 !important;
}

/* r65 tab-close refinement: Chrome-style close affordance inside the tab.
   Transparent at rest, neutral X glyph, soft circular hover/focus surface. */
body .dual-workspace-tabs .clademap-workspace-tab-shell {
  position: relative !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell > .view-tab {
  max-width: 246px !important;
  padding-right: 26px !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #68717d !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
  opacity: 0.78 !important;
  z-index: 2 !important;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    opacity 0.12s ease !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close svg {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.65 !important;
  stroke-linecap: round !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-shell.active > .clademap-workspace-tab-close {
  color: #4f5965 !important;
  opacity: 1 !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close:hover {
  background: rgba(60, 64, 67, 0.14) !important;
  color: #202124 !important;
  opacity: 1 !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close:active {
  background: rgba(60, 64, 67, 0.22) !important;
}
body .dual-workspace-tabs .clademap-workspace-tab-close:focus-visible {
  background: rgba(60, 64, 67, 0.14) !important;
  color: #202124 !important;
  outline: 2px solid #8ab4f8 !important;
  outline-offset: 1px !important;
  opacity: 1 !important;
}

/* r65 final Tree / Compact tree selector: same segmented treatment as Map,
   with no bold active label. */
#app #treeSettingsScope.tree-settings-scope {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}
#app #treeSettingsScope .tree-settings-scope-btn {
  width: 100% !important;
  min-width: 0 !important;
  height: 25px !important;
  min-height: 25px !important;
  padding: 2px 8px !important;
  border: 1px solid #cfd7e2 !important;
  border-radius: 5px !important;
  background: #f8fafc !important;
  color: #4f6075 !important;
  font-size: 11.5px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}
#app #treeSettingsScope .tree-settings-scope-btn:hover {
  background: #f2f6fb !important;
  border-color: #b8c5d5 !important;
  color: #344a64 !important;
}
#app #treeSettingsScope .tree-settings-scope-btn.active,
#app #treeSettingsScope .tree-settings-scope-btn[aria-pressed='true'] {
  background: #edf4ff !important;
  border-color: #4d83f1 !important;
  color: #315fc4 !important;
  font-weight: 400 !important;
  box-shadow: none !important;
}

/* r65 pane-aware action bars. The pane, not the browser viewport, determines
   overflow. Preserve each control's intrinsic width and scroll the entire row
   so even the final Save/window action remains reachable in a narrow pane. */
/*
 * Source section 4/5: app workspace document area workspace actionbar scroll.
 * Assembles into styles/clademap.css.
 * Rules remain in their original cascade order; later sections may intentionally override these
 * declarations.
 */
#app #workspaceDocumentArea .workspace-actionbar-scroll {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 34px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  scrollbar-width: thin;
  scrollbar-color: #93abc7 #edf2f8;
  scroll-padding-inline: 8px;
  overscroll-behavior-x: contain;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll > *,
#app
  #workspaceDocumentArea
  .workspace-actionbar-scroll
  :is(
    .map-action-tools,
    .map-mode-switch,
    .map-select-wrap,
    .tree-pane-zoom-controls,
    .compact-pane-zoom-controls,
    .shared-analysis-actionbar-left,
    .shared-analysis-actionbar-right,
    .metadata-figures-actionbar-left,
    .metadata-figures-actionbar-right,
    .tab-action-cluster,
    .tab-window-controls
  )
  > * {
  flex-shrink: 0 !important;
}
#app
  #workspaceDocumentArea
  .workspace-actionbar-scroll
  :is(
    .map-action-tools,
    .shared-analysis-actionbar-left,
    .shared-analysis-actionbar-right,
    .metadata-figures-actionbar-left,
    .metadata-figures-actionbar-right
  ) {
  flex-shrink: 0 !important;
  min-width: max-content !important;
  overflow: visible !important;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll .map-mode-title {
  display: flex !important;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll .toolbar-search {
  flex: 0 0 200px !important;
  min-width: 160px !important;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll::-webkit-scrollbar {
  height: 8px;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll::-webkit-scrollbar-track {
  background: #edf2f8;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll::-webkit-scrollbar-thumb {
  background: #93abc7;
  border-radius: 8px;
  border: 2px solid #edf2f8;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll:focus-visible {
  outline: 2px solid #4d83f1;
  outline-offset: -2px;
}
/* Top-layer menus stay in their original DOM location for event handlers and
   inherited styles, but are not clipped by the horizontal scroll viewport. */
.workspace-action-menu[popover] {
  position: fixed !important;
  inset: auto;
  margin: 0 !important;
  max-height: min(70vh, 420px);
  overflow-y: auto;
}

/* Reserve a row for errors so every tab's Save and window controls stay usable. */
#app .plot-shell:has(> #errorBanner:not(.hidden)) {
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
}
#app .plot-shell > #errorBanner:not(.hidden) {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  max-height: 25vh;
  overflow-y: auto;
  margin: 4px 8px;
  border-radius: 5px;
  box-shadow: none;
  z-index: auto;
}
#app .plot-shell:has(> #errorBanner:not(.hidden)) > #workspaceDocumentArea {
  grid-row: 4 !important;
}
.workspace-action-menu[popover]:not(:popover-open) {
  display: none !important;
}
.workspace-action-menu[popover]::backdrop {
  background: transparent;
  pointer-events: none;
}
#app #workspaceDocumentArea .workspace-actionbar-scroll:is([hidden], .hidden) {
  display: none !important;
}

/* Application menus share one typography contract, both before opening and
   after app-menus.js moves their panel to document.body. The :is() anchor
   preserves the same specificity in either location; no menu depends on
   inheriting typography from #app. Explicit descendant rules also cover
   shortcuts, submenu labels and asynchronously populated plugin entries. */
:root {
  --clademap-menu-font:
    'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --clademap-menu-font-size: 11px;
  --clademap-menu-text: #26384c;
  --clademap-menu-hover: #edf3fa;
}

#app .menubar,
#app .menu-trigger {
  font-family: var(--clademap-menu-font) !important;
}
#app .menu-trigger {
  color: var(--clademap-menu-text) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

:is(#app, body) .menu-dropdown[data-menu-panel],
:is(#app, body) .menu-dropdown[data-menu-panel] :where(*) {
  font-family: var(--clademap-menu-font) !important;
  font-size: var(--clademap-menu-font-size) !important;
  font-weight: 400 !important;
  color: var(--clademap-menu-text) !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

/* Ordinary command rows, including nested menus and direct Settings targets.
   The plugin manager retains its compact icon-button dimensions. */
:is(#app, body) .menu-dropdown[data-menu-panel]:not(.plugin-manager-menu) button {
  min-height: 25px !important;
  padding: 4px 7px !important;
}

/* Keep the existing Settings icons; only the text needs to match File. */
:is(#app, body) .settings-direct-menu > button,
:is(#app, body) .settings-direct-menu #additionalPluginSettingsMenu > button {
  justify-content: flex-start !important;
  gap: 8px !important;
}

:is(#app, body) .menu-dropdown[data-menu-panel] button:hover:not(:disabled),
:is(#app, body) .menu-dropdown[data-menu-panel] button:focus-visible,
:is(#app, body) .menu-dropdown[data-menu-panel] .plugin-menu-entry:hover {
  background: var(--clademap-menu-hover) !important;
}

/* Unavailable commands remain disabled and identifiable without changing the
   shared font or introducing a separate gray text-color rule. */
:is(#app, body) .menu-dropdown[data-menu-panel] button:disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
}

:is(#app, body) .menu-dropdown[data-menu-panel] input::placeholder {
  font-family: var(--clademap-menu-font) !important;
  font-size: var(--clademap-menu-font-size) !important;
  font-weight: 400 !important;
  color: var(--clademap-menu-text) !important;
  opacity: 1 !important;
}
/* Metadata controls remain available in the main command bar and table toolbar. */
#tipLabelWidthMode[hidden] {
  display: none !important;
}
.metadata-link-column-control {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.metadata-link-column-control select {
  width: auto;
  min-width: 110px;
  max-width: 220px;
  height: 27px;
  padding: 3px 24px 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
}
/* Spacer cells carry the unrendered rows' actual height, never the row-height rule. */
#metadataEditor .metadata-grid-virtual tr:not(.virtual-spacer-row) > :is(th, td) {
  height: var(--metadata-row-height, 30px) !important;
  min-height: var(--metadata-row-height, 30px) !important;
  padding: 4px 8px !important;
}
#metadataEditor .metadata-grid-virtual .virtual-spacer-row td {
  height: var(--metadata-spacer-height) !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 0 !important;
}
#metadataEditor {
  overflow-anchor: none;
  scrollbar-gutter: stable;
}

/* Application branches share one label column; arrows and shortcuts stay right. */
:is(#app, body) .app-menu-managed:not(.plugin-manager-menu) button {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}
:is(#app, body) .app-menu-managed .menu-command-label {
  flex: 1 1 auto !important;
  min-width: 0;
  text-align: left !important;
  float: none !important;
}
:is(#app, body) .app-menu-managed button > .ui-icon {
  flex: 0 0 15px !important;
  width: 15px !important;
  height: 15px !important;
  margin: 0 !important;
}
:is(#app, body) .app-menu-managed .menu-shortcut,
:is(#app, body) .app-menu-managed .menu-choice-mark {
  flex: 0 0 auto;
  float: none !important;
  margin: 0 0 0 auto !important;
  white-space: nowrap;
}
:is(#app, body) .app-menu-managed .menu-choice-mark {
  width: 12px;
  text-align: center;
}
:is(#app, body) .app-menu-managed button[aria-current='page'] {
  background: var(--clademap-menu-hover) !important;
  box-shadow: inset 2px 0 0 var(--accent);
}
:is(#app, body) .app-menu-managed .menu-branch-open > .menu-branch-trigger {
  background: var(--clademap-menu-hover) !important;
}
:is(#app, body) .app-menu-managed.global-floating-menu:not(.plugin-manager-menu) {
  min-width: min(218px, calc(100vw - 12px)) !important;
  max-width: calc(100vw - 12px) !important;
  max-height: calc(100vh - 12px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
:is(#app, body) .app-menu-managed .menu-branch > .menu-submenu {
  display: none !important;
  position: fixed !important;
  left: var(--submenu-left, 6px) !important;
  right: auto !important;
  top: var(--submenu-top, 6px) !important;
  bottom: auto !important;
  min-width: min(218px, calc(100vw - 12px)) !important;
  max-width: calc(100vw - 12px) !important;
  max-height: calc(100vh - 12px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  z-index: 31001 !important;
}
:is(#app, body) .app-menu-managed .menu-branch.menu-branch-open > .menu-submenu {
  display: block !important;
}
:is(#app, body) .app-menu-managed [hidden] {
  display: none !important;
}

/* Storage is an ordinary inspector page, using its existing scroller. */
#app .storage-settings-page .settings-page-titlebar > div {
  flex: 1;
  min-width: 0;
}
#app .storage-refresh-btn {
  flex: 0 0 auto;
  width: 28px;
  min-height: 26px;
  padding: 4px;
}
#app .storage-setting-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel, #fff);
}
#app .storage-setting-card > div {
  flex: 1 1 170px;
  min-width: 0;
}
#app .storage-setting-card strong,
#app .storage-setting-card span,
#app .storage-setting-card small {
  display: block;
}
#app .storage-setting-card strong {
  font-size: 12px;
  margin-bottom: 4px;
}
#app .storage-setting-card span {
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}
#app .storage-setting-card small {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
#app .storage-setting-card > button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 9px;
  font: inherit;
  max-width: 100%;
}
#app .storage-policy-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  padding: 12px;
}
#app .storage-policy-section label { display: grid; gap: 5px; font-size: 12px; min-width: 0; }
#app .storage-policy-section output { display: block; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; }
#app .storage-policy-section label > output { padding: 7px; background: var(--bg); border-radius: 4px; }
#app .storage-policy-section .storage-check { display: flex; align-items: flex-start; gap: 8px; }
#app .storage-policy-section .storage-check input { flex: 0 0 auto; margin-top: 2px; }
#app .storage-policy-section input[type='number'],
#app .storage-policy-section select { width: 100%; min-width: 0; max-width: 100%; }
#app .storage-policy-section progress { width: 100%; height: 8px; accent-color: var(--accent); }
#app .storage-policy-section button { justify-self: start; white-space: normal; text-align: left; }
#app .storage-policy-section [data-storage-errors]:not(:empty) { color: var(--danger, #b42318); }
#app .storage-setting-result {
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
#app .storage-page-head {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-bottom: 4px;
  background: var(--bg);
}
#app .storage-library-status {
  display: block;
  padding: 8px 10px;
  margin-top: 6px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 600;
}
#app .storage-library-status[data-kind='warning'] { border-color: var(--danger, #b42318); }
#app .storage-page-head [data-storage-errors] { color: var(--danger, #b42318); font-size: 12px; overflow-wrap: anywhere; }
#app .storage-page-head [data-storage-result] { margin: 6px 0 0; }
#app .storage-page-head [data-storage-result][data-kind='error'] { color: var(--danger, #b42318); }
#app .storage-page-head :is([data-storage-result], [data-storage-errors]):empty { display: none; }
#app .storage-policy-section .storage-options { display: grid; gap: 9px; min-width: 0; margin-top: 10px; }
#app details.storage-policy-section { display: block; }
#app .storage-policy-section summary { display: list-item; list-style-position: inside; cursor: pointer; font-size: 12px; line-height: 1.6; }
#app .storage-advanced > summary { font-weight: 600; }
#app .storage-policy-section [hidden] { display: none !important; }
#app .storage-policy-section .storage-save-summary { color: var(--muted); }
#app .control-tab[data-tab='workflow'][hidden],
#tab-workflow > .advanced-settings[hidden] {
  display: none !important;
}

/* A toolbar dropdown restores named views without a separate settings category. */
.saved-views-popover {
  position: fixed !important;
  right: auto !important;
  bottom: auto !important;
  width: 420px !important;
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100vh - 16px) !important;
  overflow-y: auto !important;
  z-index: 31002 !important;
}
.saved-view-form {
  display: block;
  margin: 7px 0 0;
  padding: 0;
}
.saved-views-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.saved-views-search input {
  flex: 1;
  min-width: 0;
  width: auto !important;
  font: inherit;
}
#savedViewsPopover input:is([type='search'], [type='text']) {
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--ui-control-radius, 4px);
  background: var(--panel);
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
  line-height: 1.25;
  outline: none;
  box-shadow: none;
}
#savedViewsPopover input:is([type='search'], [type='text'])::placeholder {
  color: var(--muted);
  opacity: 1;
}
#savedViewsPopover input:is([type='search'], [type='text']):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}
.saved-views-search span {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.saved-view-create {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 7px;
}
.saved-view-create > summary {
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.saved-view-form > label {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--text);
}
.saved-view-name-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.saved-view-name-row > input {
  flex: 1;
  min-width: 0;
  width: auto !important;
}
.saved-view-name-row > button {
  flex: 0 0 auto;
  height: 30px;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
  font: inherit;
}
.saved-view-form > small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 5px;
}
.saved-views-list {
  display: grid;
  gap: 2px;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.saved-view-row {
  display: flex;
  gap: 2px;
  align-items: stretch;
  min-width: 0;
  min-height: 32px;
}
.saved-view-restore {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--panel, #fff);
}
.saved-view-restore strong {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-view-restore small {
  flex: 0 0 auto;
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
}
/*
 * Source section 5/5: saved view restore hover.
 * Assembles into styles/clademap.css.
 * Rules remain in their original cascade order; later sections may intentionally override these
 * declarations.
 */
.saved-view-restore:hover,
.saved-view-restore:focus-visible {
  background: var(--clademap-menu-hover, #edf3ff);
}
.saved-view-delete {
  flex: 0 0 28px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--panel, #fff);
  color: var(--muted);
}
.saved-view-delete:hover,
.saved-view-delete:focus-visible {
  border-color: var(--border);
  background: var(--clademap-menu-hover, #edf3ff);
  color: var(--text);
}
.saved-view-delete .ui-icon {
  width: 15px;
  height: 15px;
}
.saved-views-empty {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0;
}

/* Saved analyses and named snapshots have distinct, compact status marks. */
#projectTree .analysis-open > svg {
  color: #3e78bc;
}
#projectTree [data-analysis-module='compact'] .analysis-open > svg {
  color: #8a62b4;
}
#projectTree [data-analysis-module='metadata'] .analysis-open > svg {
  color: #168f97;
}
#projectTree [data-analysis-module='figures'] .analysis-open > svg {
  color: #d18a25;
}
#projectTree [data-analysis-module='clusters'] .analysis-open > svg {
  color: #6c67bf;
}
#projectTree [data-analysis-module='analysis'] .analysis-open > svg {
  color: #2b9b79;
}
#projectTree [data-analysis-module='phylo'] .analysis-open > svg {
  color: #548b41;
}
#projectTree [data-analysis-module='outbreak'] .analysis-open > svg {
  color: #c56857;
}
#projectTree [data-analysis-module^='maps-'] .analysis-open > svg {
  color: #21958f;
}
#projectTree [data-analysis-module='profile-mst'] .analysis-open > svg {
  color: #ad6a9e;
}
#projectTree .analysis-saved-status {
  display: inline-flex;
  color: #28826d;
}
#projectTree .analysis-saved-status svg {
  width: 12px;
  height: 12px;
}
#projectTree .analysis-snapshot-icon {
  display: inline-flex;
  flex: none;
  color: #5b83ac;
}
#projectTree .analysis-snapshot-icon svg {
  width: 13px;
  height: 13px;
}
