.cashbook-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: .85rem;
}

.cashbook-filters > .text-button { align-self: center; }
.cashbook-metrics .stat strong { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
.cashbook-selection { justify-content: space-between; gap: .4rem .85rem; }
.cashbook-batch-actions { justify-content: flex-end; gap: .45rem; }
.cashbook-pages { justify-content: center; }

.cashbook-table-wrap { overflow: auto; max-width: 100%; }
.cashbook-table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
}

.cashbook-table :is(th, td) { padding: .67rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cashbook-table thead th { color: var(--muted); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.cashbook-table th[scope="row"] { min-width: 9rem; max-width: 18rem; font-weight: 500; overflow-wrap: anywhere; }
.cashbook-table th[scope="row"] small { display: block; margin-top: .2rem; color: var(--muted); }
.cashbook-table :is(code, button, time), .cashbook-amount { white-space: nowrap; }
.cashbook-table td input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--olive);
  cursor: pointer;
  vertical-align: middle;
}
.cashbook-status[data-status="ready"], .cashbook-status[data-status="imported"] { background: var(--sage); }
.cashbook-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.cashbook-detail-summary { display: flex; justify-content: space-between; align-items: start; gap: .55rem .85rem; }
.cashbook-detail-summary > div { min-width: 0; overflow-wrap: anywhere; }
.cashbook-detail-summary p { margin: .18rem 0 0; color: var(--muted); font-size: .88rem; }
.cashbook-detail-actions { gap: .42rem; }
[data-cashbook-editor]:empty { display: none; }
.cashbook-action-form { padding: .85rem; border: 1px solid var(--line); border-radius: var(--radius-field); }
.cashbook-form-actions { justify-content: flex-end; }
.cashbook-history-list { padding: 0; margin: 0; list-style: none; }
.cashbook-history-list li { display: grid; gap: .25rem; padding: .55rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.cashbook-history-list p { margin: 0; font-size: .9rem; }
.cashbook-batch-dialog { width: min(760px, calc(100% - 2rem)); }
.cashbook-preview { max-height: min(48vh, 31rem); }
.cashbook-preview thead th { position: sticky; top: 0; background: var(--paper); }
.cashbook-preview td:last-child { min-width: 8rem; overflow-wrap: anywhere; }

@media (max-width: 650px) {
  .cashbook-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cashbook-filters > .text-button { grid-column: 1 / -1; }
  .cashbook-batch-actions { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .cashbook-detail-summary { flex-wrap: wrap; }
  .cashbook-batch-dialog { width: calc(100% - 1rem); }
}
