.history-page {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}
.history-page .pagehead {
  margin: 0;
}
.history-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 0.75rem;
  align-items: end;
}
.history-filters label,
.match-dialog label {
  margin: 0;
}
.history-page td {
  vertical-align: top;
}
.history-page td > small,
.history-page td > details small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.history-actions button {
  display: block;
  text-align: left;
  min-height: 30px;
}
.history-message,
.history-pages {
  padding: 1rem;
}
.history-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.history-page summary {
  cursor: pointer;
}
.match-dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: min(28rem, calc(100vw - 2rem));
  width: 100%;
  padding: 1.4rem;
}
.match-dialog::backdrop {
  background: rgba(20, 30, 33, 0.5);
}
.match-dialog form {
  display: grid;
  gap: 0.75rem;
}
.match-dialog h2,
.match-dialog p {
  margin: 0;
}
.match-dialog p {
  color: var(--muted);
  font-size: 0.9rem;
}
.match-error {
  color: var(--red);
}
.match-error:empty,
.match-difference:empty {
  display: none;
}
.demand-summary {
  margin-bottom: 1rem;
}
.demand-summary dl {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem 3rem;
  padding: 1rem 1.25rem;
  margin: 0;
}
.demand-summary dt,
.demand-summary small {
  color: var(--muted);
  font-size: 0.85rem;
}
.demand-summary dd {
  margin: 0.3rem 0 0;
  font-weight: 650;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.refund-dialog > * + * { margin-top: .85rem; }
.refund-dialog form { margin: 1rem 0; display: grid; gap: .75rem; }
.refund-dialog details { margin: 1rem 0; }
.refund-dialog .refund-check { display:flex; align-items:center; gap:.6rem; font-weight:400; }
.refund-dialog .refund-check input { width:1.15rem; min-height:0; height:1.15rem; flex:none; }
.refund-records { padding-left:1.2rem; }
.refund-records li { margin:.5rem 0; overflow-wrap:anywhere; }
.refund-records small { display:block; }
