.rank-history {
  margin-top: 22px;
  min-width: 0;
}

.history-settings, .history-selection, .history-inspect, .history-names {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.history-settings { margin: 16px 0 12px; }
.history-settings .tabs { margin: 0; }
.history-settings label, .history-selection label, .history-inspect label { font-size: .92rem; font-weight: 650; }
.history-settings select, .history-inspect select { margin-left: 4px; }

.history-names {
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
}

.history-names button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 9px;
  color: inherit;
  background: #fff;
}

.history-swatch { width: 24px; height: 10px; }
.history-swatch path { stroke: var(--series); stroke-width: 2.2; }
.history-plot { min-height: 255px; margin-top: 10px; }
.history-plot svg { display: block; width: 100%; height: auto; }
.history-plot text { font: 12px system-ui, sans-serif; fill: #535e52; }
.history-rule { stroke: #e5e3da; }
.history-cursor { stroke: #b4bcae; stroke-dasharray: 2 3; }

.history-readout { margin: 0; line-height: 1.5; font-size: .9rem; }
.history-data { padding: 12px 14px; margin: 15px 0 0; border-radius: 12px; }
.history-table { overflow-x: auto; }
.history-table:focus-visible { outline: 3px solid #548acc; outline-offset: 2px; }
.history-table table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .9rem; }
.history-table th, .history-table td { white-space: nowrap; text-align: right; padding: 6px 9px; border-bottom: 1px solid var(--line); }
.history-table tr > :first-child { text-align: left; }
.history-source { margin: 12px 0 0; font-size: .83rem; }
.history-source a { display: block; width: fit-content; color: var(--green); text-decoration: underline; }

@media (max-width: 530px) {
  .history-names { flex-basis: 100%; }
  .history-names button { min-height: 38px; }
  .history-table th, .history-table td { padding: 6px; }
}
