.history-wrap {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1002;
}
.history-btn {
  width: auto;
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  font-weight: 700;
}
.history-card {
  width: min(1160px, 96vw);
  max-height: min(88vh, 920px);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  background: #111827;
  color: #f9fafb;
  border: 0;
  box-shadow: none;
  position: relative;
}
.history-card button,
.history-card button:hover,
.history-card button:active,
.history-card button:focus,
.history-card button:focus-visible {
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
  transition: none !important;
}
.history-card input,
.history-card select,
.history-card input:focus,
.history-card select:focus,
.history-card input:focus-visible,
.history-card select:focus-visible {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
  outline: none;
}
.history-head {
  display: none;
}
.history-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.history-copy .dialog-title {
  margin-bottom: 0;
}
.history-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
}
.history-layout {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.history-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-panel {
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 0;
  background: #0f172a;
  box-shadow: none;
}
.history-list {
  display: grid;
  overflow: auto;
}
.history-section {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #0f172a;
}
.history-section:last-child {
  border-bottom: 0;
}
.history-section-head {
  display: none;
}
.history-section-head strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #fff;
}
.history-controls {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  padding: 8px 10px 8px;
  overflow: visible;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.history-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}
.history-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px;
  border-radius: 12px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
}
.history-mode-btn {
  min-width: 86px;
  padding: 6px 12px;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  border: 0;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.history-mode-btn.active {
  background: #2563eb;
  color: #eff6ff;
}
.history-controls-grid {
  display: grid;
  grid-template-columns: minmax(100px, 130px) minmax(140px, 170px) minmax(140px, 170px) minmax(180px, 240px) auto minmax(120px, 1fr);
  align-items: end;
  gap: 8px;
}
.history-controls-grid.hidden {
  display: none;
}
.history-field {
  display: grid;
  gap: 4px;
}
.history-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 16px;
}
.history-field label {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.history-field input,
.history-field select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  background: #1f2937;
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
}
.history-field input[type="date"] {
  padding-right: 14px;
}
.history-controls-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  padding-left: 4px;
}
.history-browse-status {
  min-height: 18px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  white-space: nowrap;
}
.history-ready-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.78);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.history-ready-filter.hidden {
  display: none;
}
.history-ready-filter input {
  width: 13px;
  height: 13px;
  min-height: 13px;
  margin: 0;
  accent-color: #2563eb;
}
.history-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.history-search-btn,
.history-download-btn,
.history-copy-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1;
}
#historyCloseBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 72px;
  z-index: 5;
}
.history-browse-status.bad {
  color: #fdba74;
}
.history-browse-status.ok {
  color: #86efac;
}
.history-remote-results {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  padding: 12px 14px 14px;
  background: #0f172a;
}
.history-remote-summary {
  display: none;
}
.history-remote-results .multi-search-table-wrap {
  max-height: min(52vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: #111827;
}
.history-remote-results .multi-search-table {
  width: 100%;
  table-layout: fixed;
}
.history-remote-results .multi-search-table th,
.history-remote-results .multi-search-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.history-remote-results .multi-search-table th:nth-child(1),
.history-remote-results .multi-search-table td:nth-child(1) {
  width: 28%;
}
.history-remote-results .multi-search-table th:nth-child(2),
.history-remote-results .multi-search-table td:nth-child(2) {
  width: 10%;
}
.history-remote-results .multi-search-table th:nth-child(3),
.history-remote-results .multi-search-table td:nth-child(3) {
  width: 12%;
}
.history-remote-results .multi-search-table th:nth-child(4),
.history-remote-results .multi-search-table td:nth-child(4) {
  width: 18%;
}
.history-remote-results .multi-search-table th:nth-child(5),
.history-remote-results .multi-search-table td:nth-child(5) {
  width: 18%;
}
.history-remote-results .multi-search-table th:nth-child(6),
.history-remote-results .multi-search-table td:nth-child(6) {
  width: 14%;
}
.history-ready-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(11, 142, 78, 0.12);
  color: #0b8e4e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}
.history-empty {
  padding: 14px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  background: #111827;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}
.history-local-list {
  display: grid;
}
.history-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #0f172a;
}
.history-item:last-child {
  border-bottom: 0;
}
.history-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.history-title strong {
  font-size: 14px;
  color: #fff;
}
.history-time {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}
.history-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
}
