/* Transaction History Platform V2 */

.tx-history-surface {
  max-width: 920px;
  margin: 0 auto;
  color: #f3efe6;
  padding-bottom: 28px;
}

.tx-history-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.tx-history-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9b27a;
}

.tx-history-title {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
}

.tx-history-lead {
  margin: 0;
  color: #cfc6b4;
  line-height: 1.45;
  max-width: 52ch;
}

.tx-history-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tx-history-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.tx-history-filter.is-active {
  border-color: #c9b27a;
  color: #fff8ea;
}

.tx-history-day-title {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  color: #c9b27a;
}

.tx-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tx-history-row-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(201, 178, 122, 0.28);
  background: rgba(20, 18, 16, 0.55);
  color: inherit;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.tx-history-row-btn:focus-visible {
  outline: 2px solid #c9b27a;
  outline-offset: 2px;
}

.tx-history-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(201, 178, 122, 0.15);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tx-history-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tx-history-row-title {
  font-size: 0.98rem;
}

.tx-history-row-sub,
.tx-history-row-time {
  color: #b9b0a0;
  font-size: 0.82rem;
}

.tx-history-amount {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tx-history-amount.is-credit {
  color: #9fdfb0;
}

.tx-history-amount.is-debit {
  color: #f0a8a0;
}

.tx-history-amount.is-xp {
  color: #d7c08a;
}

.tx-history-empty,
.tx-history-loading {
  color: #cfc6b4;
  padding: 28px 8px;
  text-align: center;
}

.tx-history-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.tx-history-dialog {
  border: 1px solid rgba(201, 178, 122, 0.35);
  border-radius: 14px;
  background: #1a1714;
  color: #f3efe6;
  padding: 0;
  max-width: min(520px, calc(100vw - 24px));
  width: min(520px, calc(100vw - 24px));
}

.tx-history-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.tx-history-dialog-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.tx-history-detail-list,
.tx-history-detail-dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.tx-history-detail-list div,
.tx-history-detail-row {
  display: grid;
  gap: 2px;
}

.tx-history-detail-list dt,
.tx-history-detail-row dt {
  color: #b9b0a0;
  font-size: 0.78rem;
}

.tx-history-detail-list dd,
.tx-history-detail-row dd {
  margin: 0;
  word-break: break-word;
}

.tx-history-tech {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.65rem;
  margin-top: 0.25rem;
}

.tx-history-tech summary {
  cursor: pointer;
  color: #b9b0a0;
  font-size: 0.85rem;
}

.tx-history-copy-ref {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}

@media (max-width: 720px) {
  .tx-history-header {
    flex-direction: column;
  }

  .tx-history-row-btn {
    grid-template-columns: auto 1fr;
  }

  .tx-history-amount {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tx-history-row-btn {
    transition: none;
  }
}
