.ledger-summary {
  border-top: 1px solid var(--line);
  background: #f7fafc;
  padding: 9px 16px;
  color: var(--ink);
}
.ledger-summary[hidden] { display: none; }
.ledger-summary-controls, .ledger-summary-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.ledger-summary-controls { margin-bottom: 6px; }
.ledger-summary-field { font-size: 12px; font-weight: 600; }
.ledger-summary-field select, .ledger-summary-controls button {
  padding: 3px 8px;
  font-size: 12px;
  min-height: 27px;
}
.ledger-summary-hint { font-size: 11px; color: #596d7a; }
.ledger-summary-controls button { margin-left: auto; }
.ledger-summary-controls button:disabled { cursor: default; }
.ledger-summary-results { max-height: 160px; overflow: auto; }
table.ledger-summary-values {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ledger-summary-values th, .ledger-summary-values td { padding: 4px 8px; text-align: right; }
.ledger-summary-values th:first-child { text-align: left; }
.ledger-summary-values thead th {
  position: sticky;
  top: 0;
  background: #f7fafc;
  color: #586c79;
  font-weight: 500;
  border-bottom: 1px solid #d5e1e8;
  white-space: nowrap;
}
.ledger-summary-values tbody th { font-weight: 500; }
.ledger-summary-values strong { white-space: nowrap; font-weight: 650; }
.ledger-summary-values small { display: block; color: #87580c; }
td[data-sum-col] { cursor: cell; }
td[data-sum-col]:focus-visible { outline: 2px solid #0c679c; outline-offset: -2px; }
table td[data-sum-col].sum-selected {
  box-shadow: inset 0 0 0 2px #397ca2;
  background-color: #e2eff7;
}
@media (max-width: 768px) {
  .ledger-summary { padding: 8px; }
  .ledger-summary-hint { flex-basis: 100%; order: 1; }
  .ledger-summary-values th, .ledger-summary-values td { padding: 4px; }
}
