@layer registry-history {
.history-direct-dialog[open] {
  box-sizing: border-box !important;
  position: fixed !important;
  inset: auto !important;
  top: calc(var(--history-top, 0px) + var(--history-height, 100dvh) / 2) !important;
  left: calc(var(--history-left, 0px) + var(--history-width, 100dvw) / 2) !important;
  transform: translate(-50%, -50%) !important;
  width: min(50rem, calc(var(--history-width, 100dvw) - 12px)) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: min(38rem, calc(var(--history-height, 100dvh) - 12px)) !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: visible !important;
}

.history-direct-dialog > .dialog-heading {
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 4px 8px !important;
}

.history-direct-dialog > .dialog-heading h2 {
  margin: 0 !important;
}

.history-direct-dialog > .dialog-heading .icon-button {
  width: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
}

.history-direct-dialog > .compact-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 6px 8px !important;
  margin: 0 !important;
  overflow: visible !important;
}

.history-direct-dialog .history-activity {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4px;
}

.history-direct-dialog .history-sections,
.history-direct-dialog .history-pagination {
  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 4px !important;
  padding: 0 !important;
  margin: 0 !important;
  align-items: stretch !important;
}

.history-direct-dialog :is(.history-sections,.history-pagination) > button {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 4px !important;
  white-space: normal !important;
}

.history-direct-dialog .history-sections > button[aria-pressed="true"] {
  color: #101b39 !important;
  background: #e3c878 !important;
}

.history-direct-dialog #history-list {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 4px;
}

.history-direct-dialog #history-list :is(.empty,.change-row,.history-finance-row) {
  overflow-wrap: anywhere;
}

.history-direct-dialog .history-finance-row {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: baseline;
  padding: 8px 2px;
  border-bottom: 1px solid #d8c797;
}

.history-direct-dialog .history-amount {
  font-variant-numeric: tabular-nums;
  justify-self: end;
}

.history-direct-dialog #history-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .history-direct-dialog .history-finance-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
  }
  .history-direct-dialog .history-saved-at { grid-column: 1 / -1; }
}

[data-presentation="phone"] .history-direct-dialog .history-finance-row {
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 2px;
}

[data-presentation="phone"] .history-direct-dialog .history-saved-at {
  grid-column: 1 / -1;
}
}
