/* Shared tool UI scale, loaded last on every tool page.
   BLAST uses ~14px labels and ~17px group headings. Use a more generous
   16px primary / 14px secondary scale; rem units respect browser settings.
   SVG figure labels retain their independent, export-controlled sizing. */
html { font-size: 100%; }
body { font-size: 1rem; line-height: 1.6; }

/* Match SpacerMap: group headings sit in the upper border at the left. */
body fieldset.tool-block {
  min-width: 0;
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line, #dfe7eb);
  border-radius: 7px;
  background: #fff;
}
body .tool-block > .tool-block-title {
  float: none;
  width: auto;
  max-width: 100%;
  margin-left: -7px;
  padding: 0 7px;
  text-align: left;
  color: var(--text, var(--ink, #203b48));
}
body .tool-block-title h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
body .tool-block > :is(.panel-heading, .card-heading, .input-title) {
  align-items: flex-start;
  text-align: left;
}
body .tool-block > :is(.panel-heading, .card-heading, .input-title) > :is(button, .small-tag, .status-tag, .panel-kicker):last-child {
  margin-left: auto;
}
body .tool-block.match-card { margin-bottom: 23px; }

body :is(button, input, select, textarea, label, legend) {
  font-size: 1rem;
}
body :is(button, select, textarea) { line-height: 1.5; }
body :is(.hero p:not(.eyebrow), .tool-page-copy p, .field-label,
  .dropzone-title, .database-choice strong, .processing-checks strong,
  .side-active, .side-steps, .workspace-side-active, .workspace-steps,
  .topbar nav, .workspace-topbar nav) { font-size: 1rem; }

body :is(.hint, .toolbar-label, .panel-kicker, .toolbar-note,
  .typing-helper-text, .dropzone-meta, .customization-note,
  .customization-inline-note, .tool-crumbs, .tool-page-eyebrow,
  .tool-side-badge, .tool-side-grid label, .panel-heading p,
  .tree-viewer-label, .tree-zoom-value, .tree-newick, .tree-log,
  .brand-text > span, .site-footer, .result-metric-card > span,
  .ct-label, .tree-newick-details summary, th, td) {
  font-size: .875rem;
}
body :is(.panel-heading h2, .spacer-block-title h2) { font-size: 1.125rem; }

/* Let navigation, action rows and captions grow with the larger type. */
:is(.sidebar, .workspace-sidebar) { overflow-y: auto; }
:is(.topbar, .workspace-topbar) { gap: 24px; }
:is(.input-tabs, .card-heading, .input-title, .input-footer,
  .batch-option, .table-pagination, .run-bar, .export-bar,
  .tree-viewer-toolbar, .tree-viewer-actions) { flex-wrap: wrap; }
:is(.small-tag, .status-tag, .button, .compact-button) { white-space: normal; }
:is(.icon-button, .compact-button) { height: auto; min-height: 36px; }
:is(.legend-chip, .sidebar a, .workspace-sidebar a) { overflow-wrap: anywhere; }
.input-disclosure > summary { flex-wrap: wrap; }
.editor-grid { grid-template-columns: minmax(0, 1fr) 280px; }

@media (max-width: 1100px) {
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  :is(.topbar, .workspace-topbar) { gap: 16px; }
}
@media (max-width: 600px) {
  :is(.topbar, .workspace-topbar) { height: auto; min-height: 74px; flex-wrap: wrap; }
  :is(.topbar nav, .workspace-topbar nav) { flex-wrap: wrap; gap: 12px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .table-pagination > div { flex-wrap: wrap; flex-shrink: 1; }
}
