.history-overlay {
  z-index: 1150;
}

.modal.history-modal {
  width: min(760px, 96vw);
  min-width: min(760px, 96vw);
  max-width: min(760px, 96vw);
  min-height: min(620px, 88vh);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  box-sizing: border-box;
}

.history-modal__subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: calc(14 / 17 * 1rem);
  line-height: 1.35;
}

.history-modal__list {
  flex: 1 1 auto;
  min-height: 420px;
  max-height: none;
  overflow-y: auto;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.history-modal__table {
  width: 100%;
  border-collapse: collapse;
}

.history-modal__thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: calc(13 / 17 * 1rem);
  font-weight: 650;
  color: var(--muted);
  padding: 12px 14px;
  background: #1a1f2b;
  border-bottom: 1px solid var(--border);
}

.history-modal__row td {
  padding: 14px;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: calc(15 / 17 * 1rem);
  line-height: 1.4;
}

.history-modal__row:last-child td {
  border-bottom: none;
}

.history-modal__time {
  white-space: nowrap;
  color: var(--muted);
  font-size: calc(14 / 17 * 1rem);
  width: 34%;
}

.history-modal__summary {
  color: var(--text);
}

.history-modal__actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.history-modal__restore {
  padding: 10px 14px;
}

.history-modal__empty,
.history-modal__loading,
.history-modal__error {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-size: calc(15 / 17 * 1rem);
}
