.tally-table {
  width: 100%;
  border-collapse: collapse;
  color: #273e58;
  font-size: 13px;
  text-align: left;
}
.tally-table th, .tally-table td {
  padding: 14px clamp(10px, 1.7vw, 24px);
  border-bottom: 1px solid #e3eaf3;
  vertical-align: middle;
}
.tally-table th { background: #f6f8fb; color: #53667c; font-size: 12px; font-weight: 550; }
.tally-table tr:last-child td { border-bottom: none; }
.tally-table .tally-count { font-variant-numeric: tabular-nums; text-align: right; }
.tally-table .tally-count, .tally-table .tally-date { width: 1%; white-space: nowrap; }
.tally-table .badge { font-size: 11px; padding: 4px 7px; }
.tally-empty { margin: 0; padding: 34px 20px; color: #526781; text-align: center; }
@media (max-width: 600px) {
  .tally-table th, .tally-table td { padding: 11px 8px; }
  .tally-table { font-size: 12px; }
  .tally-table .tally-count, .tally-table .tally-date { width: 24%; white-space: normal; }
  .tally-table .badge { font-size: 10px; }
}

.tally-edit { display: block; margin: 6px 0 0 auto; font-size: 12px; color: #2563a6; padding: 7px 12px; border: 1px solid #b8cbe0; border-radius: 6px; background: #f7faff; font-weight: 600; }
.history-edit-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.history-edit-totals label, .history-edit-group > label { display: grid; gap: 6px; }
#history-edit-form input[type="number"] { width: 100%; min-height: 40px; border: 1px solid #b7cae1; border-radius: 7px; padding: 8px; }
.history-edit-group { border: 1px solid #dce6f4; border-radius: 10px; padding: 14px; display: grid; gap: 12px; margin: 12px 0; }
.history-edit-group fieldset { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.history-edit-group legend { font-size: 12px; color: #526781; margin-bottom: 6px; }
.history-edit-group label { font-size: 13px; }
.history-edit-group small { color: #526781; }
#history-edit-error { color: #a33226; }
@media(max-width: 480px) { .history-edit-totals { grid-template-columns: 1fr; } }

#correction-form { display: grid; gap: 16px; color: #293e58; font-size: 14px; }
#correction-form p, #correction-form .dialog-actions { margin: 0; }
#correction-form fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid #d2dfef; border-radius: 9px; }
#correction-form legend { padding: 0 5px; font-weight: 650; }
#correction-form label, .correction-account { display: grid; gap: 6px; }
#correction-form input:is([type="date"],[type="number"]) {
  min-width: 0; width: 100%; padding: 7px 9px; border: 1px solid #b8cbe0; border-radius: 6px;
  min-height: 38px; font: inherit; color: inherit; background: white;
}
#correction-form > .button { justify-self: start; }
#correction-form .correction-account { gap: 10px; }
.correction-account > .button { justify-self: end; }
.correction-options, .correction-links { display: flex; flex-wrap: wrap; gap: 6px; }
.correction-options button { padding: 7px 10px; border: 1px solid #b8cbe0; border-radius: 6px; color: #355675; }
.correction-options button[aria-pressed="true"] { background: #e5effd; border-color: #4f80bb; color: #15477f; font-weight: 650; }
.correction-keep { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.correction-numbers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.correction-options + .correction-numbers { margin-top: 10px; }
#correction-form .mobile-credit { display: flex; align-items: center; margin-top: 10px; }
#correction-form .correction-source label { display: block; margin: 8px 0; }
.correction-source small { color: #506880; }
.correction-links { align-items: center; justify-content: space-between; }
#correction-form .danger { color: #a42d27; }
#correction-form .danger-primary { background: #a42d27; color: white; }

.log-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.correction-preview { border-left: 3px solid #4f80bb; padding: 8px 12px; background: #f2f6fb; color: #254a74; }
.correction-preview:empty { display: none; }
@media (max-width: 600px) {
  .tally-edit, .correction-options button { min-height: 44px; }
  #correction-form input[type="number"], #correction-form input[type="date"] { font-size: 16px; }
}
