/* Reading transactions uses the same classic colour system as Budget. */
.history-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.history-kind > button { min-height: 44px; padding: 10px 12px; border-radius: 11px; font-size: .9rem; font-weight: 650; color: var(--ink-2); }
.history-kind > button.on { background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow); }
.history-note { margin: 12px 2px; color: var(--ink-2); font-size: .82rem; line-height: 1.45; }
.history-search { margin: 2px 0 10px; min-height: 46px; }
.history-period { display: flex; align-items: center; gap: 8px; }
.history-period > .input { flex: 1; min-width: 0; min-height: 44px; }
.history-period > [hidden] { display: none; }
.history-more { margin: 8px 0; }
.history-more > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--brand-deep); font-size: .86rem; font-weight: 650; gap: 7px; }
.history-more > summary::before { content: '+'; font-size: 1.1rem; }
.history-more[open] > summary::before { content: '−'; }
.history-more-fields { padding: 10px 14px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.history-more-fields .input { min-height: 44px; }
.history-result-status { font-size: .8rem; color: var(--ink-2); margin: 14px 2px 8px; line-height: 1.4; }
.history-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 16px; background: var(--brand-tint); font-size: .85rem; }
.history-total strong { color: var(--brand-deep); font-variant-numeric: tabular-nums; font-size: 1.08rem; overflow-wrap: anywhere; }
.history-total-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.history-total-group .history-total { flex-direction: column; align-items: flex-start; gap: 5px; }
.history-available { font-size: .75rem; line-height: 1.5; color: var(--ink-2); margin: 14px 3px 8px; }
.history-list { margin-top: 12px; background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.history-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 15px 12px; width: 100%; min-height: 64px; border-bottom: 1px solid var(--border); text-align: left; }
.history-row:last-child { border-bottom: 0; }
.history-row:active { background: var(--surface-2); }
.history-row-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--brand-tint); color: var(--brand-deep); }
.history-row-icon > .icon { width: 18px; height: 18px; }
.history-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.history-row-name { font-size: .9rem; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.history-row-note { font-size: .83rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row-meta, .history-row-author { font-size: .73rem; color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }
.history-row-amount { font-variant-numeric: tabular-nums; font-size: .9rem; line-height: 1.35; padding-top: 1px; text-align: right; max-width: 9.5em; overflow-wrap: anywhere; }
.history-money-in { color: var(--brand-deep); }
.history-row-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.history-badge { display: inline-block; font-size: .67rem; line-height: 1.5; padding: 2px 7px; border-radius: 6px; color: var(--ink-2); background: var(--surface-2); }
.history-load { margin-top: 14px; min-height: 44px; }
.history-clear { min-height: 44px; margin: 8px auto; display: flex; }
.history-empty { text-align: center; padding: 30px 18px; color: var(--ink-2); }
.history-empty > .icon { width: 30px; height: 30px; margin-bottom: 10px; color: var(--brand); }
.history-empty h2 { font-size: 1.05rem; color: var(--ink); margin-bottom: 7px; }
.history-empty p { font-size: .85rem; line-height: 1.5; }
.history-recent { padding: 16px; }
.history-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-card-head h2 { margin: 0; font-size: 1rem; }
.history-card-head > button { display: inline-flex; align-items: center; gap: 2px; flex: none; min-height: 44px; font-size: .82rem; }
.history-card-head .icon { width: 16px; height: 16px; }
.history-card-period { color: var(--ink-2); font-size: .77rem; margin-top: 1px; }
.history-recent .history-list { margin: 7px -7px -4px; border-radius: 0; }
.history-recent .history-row { padding: 13px 7px; }
.history-empty-small { color: var(--ink-2); font-size: .85rem; line-height: 1.45; padding: 20px 0 6px; }
@media (max-width: 350px) { .history-row { grid-template-columns: 26px minmax(0, 1fr); gap: 8px; } .history-row-amount { grid-column: 2; text-align: left; } }

.history-range { font-size: .78rem; line-height: 1.45; color: var(--ink-2); margin: 0 3px 10px; }

/* Month dividers and daily totals keep long payment histories easy to scan. */
.history-month { margin-top: 26px; }
.history-month-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: var(--brand-deep); font-size: 1rem; font-weight: 700; }
.history-month-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.history-day, .history-income-group { margin-top: 18px; }
.history-group-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding: 0 3px; }
.history-day-title { margin: 0; font-size: .83rem; font-weight: 650; line-height: 1.4; }
.history-group-total { color: var(--ink-2); font-size: .76rem; line-height: 1.4; }
.history-group-total strong { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 650; }
.history-group-count { margin: 4px 3px 0; color: var(--ink-2); font-size: .75rem; }
.history-groups .history-list { margin-top: 8px; border: 1px solid var(--border); }
