.history-page {
  width: 100%;
  max-width: var(--page-standard);
  margin: 0 auto;
  padding: 8px 0 60px;
}

.history-heading {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 88px;
  margin-bottom: 18px;
}

.history-heading-art {
  position: relative;
  width: 220px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-art-glow {
  position: absolute;
  width: 220px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 76, 125, 0.10), rgba(236, 76, 125, 0.03) 45%, transparent 70%);
}

.history-heading-bg {
  position: absolute;
  top: 20px;
  
  width: 190px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
}

.history-heading h1 {
  margin: 8px 0 10px;
  font-size: 32px;
  line-height: 1.2;
}

.history-description {
  margin: 0;
  font-size: 14px;
  color: #756b67;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;

  background: #fff;
  border: 1px solid #eadfda;
  border-radius: 16px;
}

.history-search {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 320px;
  height: 46px;
  padding: 0 16px;

  border: 1px solid #e5d9d4;
  border-radius: 10px;
  background: #fff;
}

.history-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.search-icon {
  margin-right: 10px;
  color: #998d87;
}

.history-filter,
.history-page-size {
  height: 46px;
  padding: 0 38px 0 14px;

  border: 1px solid #e5d9d4;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.history-reset {
  height: 46px;
  white-space: nowrap;
}

.history-card {
  overflow: hidden;

  background: #fff;
  border: 1px solid #eadfda;
  border-radius: 16px;
}

.history-card > .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 20px 22px;
  border-bottom: 1px solid #eee4df;
}

.history-card .section-header h2 {
  margin: 0;
  font-size: 17px;
}

.history-count {
  display: inline-block;
  margin: 6px 0 0;
  font-size: 13px;
  color: #968b86;
}

.history-management {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.history-selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-selection-actions > strong {
  margin-right: 4px;
  font-size: 13px;
  color: #756b67;
}

.history-manage-button,
.history-selection-actions button {
  min-height: 38px;
}

.danger-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #d9446f;
  border-radius: 10px;
  background: #d9446f;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:disabled {
  opacity: .4;
  cursor: default;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  height: 46px;
  padding: 0 18px;
  text-align: left;

  font-size: 12px;
  color: #756b67;
  background: #fdfaf8;
}

.history-table td {
  height: 68px;
  padding: 0 18px;

  border-top: 1px solid #f0e7e3;
  font-size: 13px;
}

.history-select-column {
  width: 48px;
  padding-left: 18px !important;
  padding-right: 0 !important;
}

.history-row-checkbox {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #ec4c7d;
  cursor: pointer;
}

.history-row-checkbox:disabled {
  cursor: default;
}

.history-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  padding: 18px 22px;
  border-top: 1px solid #eee4df;
}

.pagination-buttons {
  display: flex;
  gap: 6px;
}

.pagination-buttons button {
  width: 36px;
  height: 36px;

  border: 1px solid #e5d9d4;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.pagination-buttons button.active {
  border-color: #ec4c7d;
  background: #ec4c7d;
  color: #fff;
}

.history-page-size {
  justify-self: end;
  height: 38px;
}

.history-page-size-label {
  justify-self: end;
  font-size: 13px;
  color: #8a7f79;
}

.pagination-info {
  font-size: 13px;
  color: #8a7f79;
}

/* connected history states */
.history-row {
  cursor: pointer;
  transition: background .16s ease;
}
.history-row:hover,
.history-row:focus-visible {
  background: #fffafc;
  outline: none;
}
.history-row.management-row {
  cursor: pointer;
}
.history-row.history-row-selected {
  background: #fff5f8;
}
.history-row.history-row-disabled {
  cursor: default;
  opacity: .62;
}
.history-row.history-row-disabled:hover,
.history-row.history-row-disabled:focus-visible {
  background: #fff;
}
.history-loading-row td {
  height: 110px;
  text-align: center;
  color: #968b86;
}
.history-page-buttons {
  display: flex;
  gap: 6px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-complete { background: #eaf6ee; color: #39714a; }
.status-review { background: #fff0f5; color: #b63b67; }
.status-processing { background: #eef4fb; color: #3e6b93; }
.status-pending { background: #f5f1ea; color: #776858; }
.status-failed { background: #fff0ee; color: #b34a3e; }
.status-muted { background: #f1f1ef; color: #77746f; }
.table-action {
  color: #d93f71;
  font-weight: 700;
  white-space: nowrap;
}

.history-delete-modal {
  max-width: 480px;
}

.history-delete-modal > p:not(.eyebrow) {
  margin: 12px 0 0;
  color: #756b67;
  font-size: 14px;
  line-height: 1.7;
}

.history-delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.history-pagination button:disabled {
  opacity: .35;
  cursor: default;
}
.empty-state {
  min-height:180px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:6px;
  padding:32px 20px;
  text-align: center;
  color: #968b86;
}
.empty-state strong{color:var(--brown);font-size:15px}
.empty-state span{font-size:13px}
.history-empty-action{min-height:42px;margin-top:10px;padding:0 18px;font-size:13px}
@media (max-width: 900px) {
  .history-toolbar { flex-wrap: wrap; }
  .history-search { min-width: 100%; }
  .analysis-table-wrap { overflow-x: auto; }
  .history-table { min-width: 860px; }
  .history-pagination {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pagination-buttons,
  .history-page-size,
  .history-page-size-label { justify-self: start; }

  .history-card > .section-header {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

  .history-management {
    width: 100%;
    justify-content: flex-start;
  }

  .history-selection-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 820px) {
  .history-heading { min-height:76px; }
  .history-heading-art { display:none; }
}
.history-support-link{color:var(--orange);font-size:11px;font-weight:800;white-space:nowrap}.history-support-link:hover{text-decoration:underline}
.history-source-badge{display:block;width:max-content;margin-top:4px;padding:2px 6px;border-radius:999px;background:#f1ece8;color:#6d615b;font-size:11px;font-weight:800}.history-source-badge.personal{background:#edf6f1;color:#35634d}
