:root {
  --navy-950: #07131f;
  --navy-900: #0b1f31;
  --navy-800: #12334a;
  --navy-700: #1d4860;
  --paper: #f4f1e9;
  --surface: #fffdf7;
  --ink: #17232d;
  --muted: #64717a;
  --line: #d8d7d0;
  --green: #087f5b;
  --green-soft: #d9f3e8;
  --red: #bf3d3d;
  --red-soft: #f9e2df;
  --gold: #e1a83b;
  --shadow: 0 16px 40px rgba(7, 19, 31, .10);
  --radius: 16px;
}

/* Whole-budget income and spending report. */
.bucket-spending-link { color: var(--ink); text-decoration: none; border-radius: 6px; }
.bucket-spending-link .horizontal-bar-label strong { text-decoration: underline; }
.bucket-spending-link:hover, .bucket-spending-link:focus-visible { background: var(--paper); outline: 2px solid var(--line); outline-offset: 5px; }
.bucket-other-expenses { margin-top: 20px; }
.bucket-other-expenses summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--navy-700); }
.report-chart-panel.bucket-spending-report { min-height: 0; }
.bucket-spending-report .bucket-period-note { margin-top: 18px; font-size: 13px; }
.bucket-period-scroll { width: 100%; max-width: 100%; margin-top: 16px; overflow-x: auto; }
.bucket-period-scroll svg { display: block; height: 285px; }
.bucket-period-scroll svg[hidden] { display: none; }
.bucket-period-frame { position: relative; margin-top: 16px; }
.bucket-period-frame .bucket-period-scroll { margin-top: 0; }
.bucket-period-axis { position: absolute; left: 0; top: 0; width: 58px; height: 285px; background: var(--surface); z-index: 1; pointer-events: none; }
.bucket-period-scroll-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.bucket-period-scroll-note:not([hidden]) { display: block; }
.bucket-period-grid { stroke: var(--line); stroke-width: 1; }
.bucket-period-zero { stroke: var(--muted); stroke-width: 1.4; }
.bucket-period-tick { fill: var(--muted); font-size: 11px; }
.bucket-period-expense { fill: var(--red); }
.bucket-period-refund { fill: var(--green); }
.bucket-period-empty { fill: var(--muted); }
.bucket-period-hit { cursor: pointer; }
.bucket-period-hit { outline: none; }
.bucket-period-hit:hover .bucket-period-hit-area, .bucket-period-hit:focus .bucket-period-hit-area, .bucket-period-hit.is-selected .bucket-period-hit-area { fill: rgba(29,72,96,.08); stroke: var(--navy-700); stroke-width: 1; }
.bucket-period-focus-week { fill: #f7e9bc; }
.bucket-parent-link { margin-right: 18px; }
.bucket-spending-report .bucket-week-context { margin-top: 8px; font-size: 12px; }
.bucket-spending-report .bucket-period-detail { min-height: 44px; padding: 10px 12px; margin-top: 12px; border-radius: 8px; background: var(--paper); font-size: 13px; }
.bucket-day-transactions { padding: 12px 0; border-top: 1px solid var(--line); }
.bucket-day-transactions h3 { margin: 0 0 6px; font-size: 18px; }
.bucket-day-transactions > small { color: var(--muted); font-size: 12px; }
.bucket-spending-report .bucket-spending-footnote { margin-top: 18px; font-size: 12px; }
.bucket-period-table { width: 100%; border-collapse: collapse; }
.bucket-period-table th, .bucket-period-table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); }
.report-chart-panel.month-comparison-report { min-height: 0; }
.month-comparison-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 20px 0 10px; }
.month-picker-field { flex: 1 1 200px; min-width: 0; }
.month-picker-field > label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.month-picker { position: relative; }
.month-picker input[type="month"], .month-picker-trigger { width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font: inherit; font-size: 14px; }
.month-picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; text-align: left; }
.month-picker-trigger svg { flex: 0 0 auto; color: var(--navy-700); }
.month-picker-trigger[hidden], .month-calendar[hidden] { display: none; }
.month-calendar { position: absolute; top: calc(100% + 6px); left: 0; width: 100%; min-width: 0; box-sizing: border-box; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 5; }
.month-calendar-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.month-calendar button { min-height: 44px; padding: 6px; border: 0; border-radius: 7px; color: var(--navy-800); background: var(--paper); cursor: pointer; font: inherit; font-size: 14px; }
.month-calendar-heading button { min-width: 44px; font-size: 22px; }
.month-calendar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.month-calendar button[aria-pressed="true"] { background: var(--navy-800); color: white; }
.month-calendar button:disabled { opacity: .35; cursor: default; }
.month-calendar button:focus-visible, .month-picker-trigger:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; }
.month-comparison-report .month-comparison-range { font-size: 13px; }
.month-summary-table table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.month-summary-table th, .month-summary-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; overflow-wrap: anywhere; }
.month-summary-table th:first-child { text-align: left; width: 20%; }
.month-summary-table th small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.month-income-total td { color: var(--green); }
.month-spending-total td { color: var(--red); }
.month-comparison-report .month-chart-guide { margin: 18px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.month-difference-chart { margin-top: 26px; }
.month-difference-chart h3 { margin: 0 0 16px; }
.month-difference-income h3 { color: var(--green); }
.month-difference-expense h3 { color: var(--red); }
.month-difference-axis { display: grid; grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); align-items: start; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.month-difference-axis > :last-child { text-align: right; }
.month-difference-axis > span { text-align: center; }
.month-difference-axis small { display: block; font-size: 11px; }
.month-difference-row { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.month-difference-row:hover, .month-difference-row:focus-visible { background: var(--paper); }
.month-difference-label { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.month-difference-label strong { text-decoration: underline; overflow-wrap: anywhere; }
.month-difference-label > span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.month-difference-amounts { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.month-difference-track { height: 24px; position: relative; margin-top: 4px; background: linear-gradient(to bottom, transparent 11px, var(--line) 11px, var(--line) 12px, transparent 12px); }
.month-difference-track::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted); transform: translateX(-.5px); }
.month-difference-bar { position: absolute; top: 5px; height: 14px; }
.month-bar-right { left: 50%; border-radius: 0 3px 3px 0; }
.month-bar-left { right: 50%; border-radius: 3px 0 0 3px; }
.month-difference-income .month-difference-bar { background: var(--green); }
.month-difference-expense .month-difference-bar { background: var(--red); }
.month-comparison-report .month-comparison-footnote { margin-top: 20px; font-size: 13px; }
.month-transactions-dialog { width: min(1080px, calc(100vw - 24px)); max-height: 85dvh; box-sizing: border-box; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); overflow: auto; }
.month-transactions-dialog::backdrop { background: rgba(7, 19, 31, .65); }
.month-dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; position: sticky; top: 0; background: var(--surface); z-index: 1; padding-bottom: 12px; }
.month-dialog-heading h2 { margin: 0; font-size: 24px; }
.month-dialog-heading button { flex: 0 0 auto; min-height: 44px; min-width: 44px; font-size: 20px; }
.month-transaction-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.month-transaction-side { min-width: 0; }
.month-transaction-side h4 { margin: 8px 0; }
.month-transaction-side > p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.month-transaction-row { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.month-transaction-row > div { min-width: 0; overflow-wrap: anywhere; }
.month-transaction-row > strong { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.month-transaction-row div strong { font-size: 13px; }
.month-transaction-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
@media (max-width: 650px) {
  .month-transaction-columns { grid-template-columns: minmax(0, 1fr); }
  .month-transactions-dialog { padding: 16px; }
  .month-summary-table th, .month-summary-table td { padding: 9px 5px; font-size: 12px; }
  .month-summary-table th:first-child { width: 72px; white-space: nowrap; }
  .month-picker input[type="month"], .month-picker-trigger { font-size: 16px; }
}
@media (max-width: 380px) {
  .month-summary-table th, .month-summary-table td { padding-inline: 4px; font-size: 11px; }
  .month-summary-table th:first-child { width: 62px; }
}
.report-chart-panel.income-spending-report { min-height: 0; }
.income-spending-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 8px; }
.income-spending-controls .is-selected { background: var(--navy-800); color: var(--surface); border-color: var(--navy-800); }
.income-spending-controls .secondary-button { padding: 9px 13px; }
.income-spending-report .income-spending-range { font-size: 13px; }
.income-spending-periods > span { margin-right: 4px; color: var(--muted); font-size: 13px; }
.income-spending-periods > label { color: var(--muted); font-size: 13px; }
.income-spending-controls select { width: auto; min-height: 44px; padding: 9px 32px 9px 13px; border: 1px solid var(--line); border-radius: 8px; background-color: var(--surface); color: var(--ink); font: inherit; }
.income-spending-result { margin: 22px 0; padding-left: 15px; border-left: 4px solid var(--line); }
.income-spending-result.positive { border-color: var(--green); }
.income-spending-result.negative { border-color: var(--red); }
.income-spending-result h3 { margin: 0 0 6px; font-size: 17px; }
.income-spending-result > strong { display: block; font: 700 32px/1.2 Georgia, serif; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.income-spending-result strong small { font: 400 15px/1.2 system-ui, sans-serif; }
.income-spending-result p { margin: 7px 0 0; font-size: 14px; color: var(--muted); }
.income-spending-comparison { margin: 24px 0 30px; }
.income-spending-bar-label { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 7px; }
.income-spending-bar-label strong { font-variant-numeric: tabular-nums; }
.income-spending-track { height: 24px; background: var(--paper); }
.income-spending-track span { height: 100%; display: block; }
.income-spending-track .income-mark { background: var(--green); }
.income-spending-track .spending-mark { background: var(--red); }
.income-spending-comparison > small { display: block; color: var(--muted); margin-top: 8px; }
.income-spending-trend h3 { margin-bottom: 6px; }
.income-spending-trend > p { margin: 6px 0; font-size: 13px; color: var(--muted); }
.income-spending-trend svg { display: block; width: 100%; height: 250px; overflow: visible; }
.income-spending-trend svg[hidden] { display: none; }
.income-spending-trend .net-trend-axis { font: 12px system-ui, sans-serif; fill: var(--muted); }
.income-spending-trend .net-trend-grid { stroke: var(--line); stroke-width: 1; }
.income-spending-trend .net-trend-zero { stroke: var(--muted); stroke-width: 1.5; }
.income-spending-trend .net-trend-line { stroke: var(--navy-700); stroke-width: 2; fill: none; }
.income-spending-trend .net-trend-positive { fill: var(--green); }
.income-spending-trend .net-trend-negative { fill: var(--red); }
.income-spending-trend .net-trend-neutral { fill: var(--muted); }
.income-spending-trend .daily-percentage-point { cursor: pointer; opacity: 0; }
.income-spending-trend .daily-percentage-selected, .income-spending-trend .daily-percentage-preview, .income-spending-trend .daily-percentage-point:focus { opacity: 1; }
.income-spending-trend .income-spending-reference { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 6 4; }
.income-spending-trend-summary { margin: 16px 0; padding: 12px 15px; border-left: 4px solid var(--line); background: var(--paper); }
.income-spending-trend-summary.positive { border-color: var(--green); }
.income-spending-trend-summary.negative { border-color: var(--red); }
.income-spending-trend-summary strong { color: var(--ink); font-size: 19px; }
.income-spending-trend-summary p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.income-spending-daily-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 8px; }
.income-spending-daily-summary > div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.income-spending-daily-summary dt { color: var(--muted); font-size: 13px; }
.income-spending-daily-summary dd { margin: 6px 0 0; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 500px) {
  .income-spending-daily-summary { grid-template-columns: 1fr; gap: 6px; }
  .income-spending-daily-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .income-spending-daily-summary dd { margin: 0; }
}
.income-sources-dialog { max-height: calc(100dvh - 32px); overflow: auto; }
.income-source-list-actions { display: flex; gap: 8px; margin: 12px 0; }
.income-source-sort { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.income-baseline-controls { flex-wrap: wrap; }
.income-baseline-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; }
.income-baseline-dates[hidden] { display: none; }
.income-baseline-dates input { min-width: 140px; max-width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.income-source-sort select { width: auto; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; }
.income-source-group { margin: 8px 6px 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.income-source-list { max-height: min(40dvh, 320px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 16px; }
.income-source-list legend { color: var(--muted); font-size: 13px; padding: 0 5px; }
.income-source-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; font-size: 14px; cursor: pointer; }
.income-source-option input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }
.income-spending-trend .daily-percentage-unavailable { fill: var(--surface); stroke: var(--muted); stroke-width: 1; }
.income-spending-trend .daily-percentage-selected { stroke: var(--navy-700); stroke-width: 2; }
.income-spending-trend .daily-percentage-point:focus { outline: 2px solid var(--navy-700); }
.income-spending-trend .net-trend-hit { fill: transparent; cursor: pointer; }
.income-spending-trend .net-trend-hit:focus { outline: 2px solid var(--navy-700); }
.income-spending-report .income-spending-month-detail { min-height: 38px; overflow-wrap: anywhere; color: var(--ink); }
.income-spending-months, .income-spending-calculation { margin-top: 18px; font-size: 13px; }
.income-spending-report summary { cursor: pointer; color: var(--navy-700); font-weight: 700; }
.income-spending-table-wrap { overflow-x: auto; margin-top: 10px; }
.income-spending-months table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.income-spending-months th, .income-spending-months td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.income-spending-months th:first-child { text-align: left; }
.income-spending-months th small { display: block; color: var(--muted); font-weight: 400; }
.income-spending-calculation p { color: var(--muted); line-height: 1.5; }
@media (max-width: 500px) {
  .income-spending-controls .secondary-button { min-height: 44px; }
  .income-spending-result > strong { font-size: 28px; }
}

/* Chase QFX reconciliation */
.bank-import-shell { max-width: 1120px; }
.bank-import-card { padding: 24px; }
.bank-import-upload-form { display: grid; gap: 22px; }
.bank-import-cutoff { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 18px; align-items: end; }
.bank-import-presets { display: flex; gap: 8px; padding-bottom: 2px; }
.bank-import-presets .secondary-button { min-width: 88px; }
.bank-import-presets .is-selected { color: var(--paper); background: var(--navy-900); border-color: var(--navy-900); }
.bank-import-explainer { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #eef5f8; }
.bank-import-explainer p { margin: 5px 0 0; color: var(--muted); }
.bank-import-review-heading { align-items: center; }
.bank-import-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.bank-import-summary > div { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.bank-import-summary strong { color: var(--green); font: 700 1.65rem/1 Georgia, serif; }
.bank-import-summary span { color: var(--muted); font-size: .84rem; }
.bank-import-row-list { display: grid; gap: 14px; }
.bank-import-review-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.bank-import-review-tabs a { padding: 10px 12px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 800; }
.bank-import-review-tabs a span { display: inline-grid; min-width: 22px; min-height: 22px; margin-left: 5px; place-items: center; border-radius: 999px; color: var(--navy-900); background: #e8eef1; font-size: .75rem; }
.bank-import-review-tabs a.is-active { color: var(--navy-900); border-bottom-color: var(--green); }
.bank-import-review-tabs a.is-disabled { opacity: .45; cursor: default; }
.bank-match-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bank-match-actions form { margin: 0; }
.bank-match-reasons { margin: 4px 0 10px; font-size: .8rem; }
.bank-match-reasons summary { cursor: pointer; text-decoration: underline; }
.bank-import-row { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf8; }
.bank-import-row-main { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.bank-import-row-main > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.bank-import-row-main h3 { margin: 3px 0; font-size: 1.05rem; }
.bank-import-row-main p { margin: 2px 0 5px; color: var(--muted); }
.bank-import-row-main > strong { white-space: nowrap; font-size: 1.15rem; }
.bank-import-row-amount { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 7px; }
.bank-import-row-amount strong { white-space: nowrap; font-size: 1.15rem; }
.bank-import-row-amount button { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.bank-import-row[data-import-row] .bank-import-row-main { align-items: flex-start; }
.bank-import-row-date { color: var(--navy-900); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.bank-import-match-box { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--navy-700); background: #eef7fb; }
.bank-import-match-box p { margin: 3px 0 7px; color: var(--muted); font-size: .86rem; }
.bank-import-match-box ul { margin: 0; padding-left: 18px; font-size: .86rem; }
.bank-import-row-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.bank-import-row-controls label { display: grid; gap: 5px; color: var(--navy-900); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bank-import-row-controls select { width: 100%; min-width: 0; }
.bank-import-row-controls .bank-import-decision { grid-column: 1; grid-row: 1; min-width: 0; }
.bank-import-row-controls [data-import-bucket], .bank-import-row-controls [data-import-match], .bank-import-row-controls [data-import-email] { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
.bank-import-row-controls .bank-import-note { grid-column: 1 / -1; min-width: 0; }
.bank-import-note textarea { width: 100%; min-height: 70px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: normal; resize: vertical; }
.bank-import-bucket-field { grid-column: span 2; min-width: 0; }
.bank-import-email input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; text-transform: none; }
.bank-import-row-controls .bank-import-decision, .bank-import-row-controls .bank-import-email { align-content: start; }
.bank-import-email small { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: normal; }
.bank-verification-status { color: var(--navy-700); font-size: 12px; overflow-wrap: anywhere; }
.bank-import-row-compact { padding: 12px; }
.bank-import-row-compact .bank-import-row-main h3 { margin-top: 0; }
.bank-import-row-compact .bank-import-row-controls { margin-top: 10px; gap: 8px; }
.bank-import-row-compact .bank-import-note { gap: 3px; }
.bank-import-row-compact .bank-import-note textarea { min-height: 36px; padding: 7px 10px; }
@media (min-width: 1000px) {
  .bank-import-row-compact { display: grid; grid-template-columns: minmax(200px, 1.25fr) minmax(160px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr); align-items: start; gap: 8px 12px; }
  .bank-import-row-compact .bank-import-row-main, .bank-import-row-compact .bank-import-row-controls { display: contents; }
  .bank-import-row-compact .bank-import-merchant { grid-column: 1; grid-row: 1 / 3; min-width: 0; }
  .bank-import-row-compact .bank-import-row-amount { grid-column: 4; grid-row: 1; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 8px; }
  .bank-import-row-compact .bank-import-decision { grid-column: 2; grid-row: 1; min-width: 0; }
  .bank-import-row-compact [data-import-bucket], .bank-import-row-compact [data-import-email] { grid-column: 3; grid-row: 1 / 3; min-width: 0; }
  .bank-import-row-compact [data-import-match] { grid-column: 2 / 4; grid-row: 2; min-width: 0; }
  .bank-import-row-compact .matching-repayment { grid-column: 4; grid-row: 2; min-width: 0; margin: 0; padding: 8px; }
  .bank-import-row-compact .matching-repayment-heading { flex-wrap: wrap; gap: 6px; }
  .bank-import-row-compact .matching-repayment-heading > strong { order: -1; margin-left: auto; }
  .bank-import-row-compact .matching-repayment-toggle { font-size: 11px; }
  .bank-import-row-compact .matching-repayment-options { grid-template-columns: 1fr; gap: 7px; margin-top: 8px; }
  .bank-import-row-compact .bank-import-note { grid-column: 1 / -1; grid-row: 3; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-heading, .bank-import-row-compact.has-matching-repayment .matching-repayment-options { display: contents; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-toggle { grid-column: 1; grid-row: 1; font-size: 12px; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-heading > strong { grid-column: 4; grid-row: 1; order: initial; margin: 0; justify-self: end; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-options > label { grid-row: 1; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-options > label:first-child { grid-column: 2; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-options > label[data-repayment-bucket] { grid-column: 3; }
  .bank-import-row-compact.has-matching-repayment .matching-repayment-options > small { grid-column: 1 / -1; grid-row: 2; }
  .bank-import-row-compact.has-matching-repayment .bank-import-note { grid-row: 4; }
  .bank-import-row-compact .bank-import-match-box, .bank-import-row-compact .bank-import-receipt { grid-column: 1 / -1; margin-top: 0; }
  .bank-import-row-compact .bank-import-control-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}
.bank-import-bucket-field > label { margin-bottom: 5px; }
.bank-import-bucket-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bank-import-bucket-choice select { flex: 1 1 150px; width: auto; }
.bank-import-bucket-choice button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.activity-dialog.bucket-history-dialog { width: min(850px, calc(100vw - 32px)); max-height: min(85dvh, 850px); padding: 18px; overflow: auto; }
.bucket-history-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bucket-history-heading h2 { margin: 0; font-size: 25px; overflow-wrap: anywhere; }
.bucket-history-heading button { flex: 0 0 auto; padding: 5px 12px; font-size: 22px; }
.bucket-history-count { color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
.bucket-history-dialog .bucket-history-filter { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: normal; cursor: pointer; }
.bucket-history-filter input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy-800); }
.bucket-history-comparison { margin: 12px 0 0; padding: 9px 12px; border-radius: 7px; background: #edf4f8; color: var(--navy-700); font-size: 13px; overflow-wrap: anywhere; }
.bucket-history-list { max-height: min(55dvh, 560px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.bucket-history-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bucket-history-row-heading { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; }
.bucket-history-row-heading > strong:first-child { min-width: 0; overflow-wrap: anywhere; }
.bucket-history-row-heading > strong:last-child { flex: 0 0 auto; }
.bucket-history-row small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.5; }
.bucket-history-row .transaction-meta-expense { color: var(--red); }
.bucket-history-row .transaction-meta-income { color: var(--green); }
.bucket-history-row .transaction-meta-funding { color: #0877bd; }
.bucket-history-pagination { gap: 12px; padding-top: 14px; }
.bucket-history-loading p { color: var(--muted); font-size: 14px; }
.bucket-history-match-action { display: flex; justify-content: flex-end; margin-top: 7px; }
.bucket-history-match-action:empty { display: none; }
.bucket-history-match-action button { padding: 5px 10px; font-size: 12px; }
.bucket-history-match-status { color: var(--muted); font-size: 12px; }
.history-match-notice { color: var(--green); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: normal; }
.bank-import-row-controls [hidden] { display: none !important; }
.bucket-history-dialog [hidden], .bank-import-bucket-field [hidden] { display: none !important; }
.bank-import-row-controls > [hidden] { display: none !important; }
.bank-import-save-actions { justify-content: end; margin-top: 20px; }
.bank-import-complete { text-align: center; }
.bank-import-resolved { margin-top: 18px; }
.bank-import-resolved details { border-top: 1px solid var(--line); padding: 12px 0; }
.bank-import-resolved summary { display: flex; justify-content: space-between; cursor: pointer; color: var(--navy-900); font-weight: 700; }
.bank-import-resolved details p { margin: 8px 0 0; color: var(--muted); font-size: .88rem; }
.bank-import-resolved-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bank-import-resolved-row form { margin: 8px 0 0; flex: 0 0 auto; }
.bank-import-payment-warning { display: block; margin-top: 10px; color: var(--red); }

@media (max-width: 800px) {
  .bank-import-cutoff, .bank-import-row-controls { grid-template-columns: 1fr; }
  .bank-import-row-controls [data-import-bucket], .bank-import-row-controls [data-import-match], .bank-import-row-controls [data-import-email] { grid-column: 1; grid-row: 2; }
  .bank-import-bucket-field { grid-column: auto; }
  .bank-import-presets { display: grid; grid-template-columns: repeat(3, 1fr); }
  .bank-import-presets .secondary-button { min-width: 0; padding-inline: 8px; }
  .bank-import-summary { grid-template-columns: repeat(2, 1fr); }
  .bank-import-row-main { align-items: center; }
  .bank-import-resolved-row { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* Shared shopping list */
.shopping-page { max-width: 1120px; margin: 0 auto; padding: 34px 24px 70px; }
.shopping-heading { margin-bottom: 18px; }
.shopping-heading h1 { margin-bottom: 4px; }
.shopping-heading p { margin: 0; color: var(--muted, #586d63); }
.shopping-list-card {
  background: #fffef9; border: 1px solid #d8ddd6; border-radius: 18px; padding: 20px;
  box-shadow: 0 10px 28px rgba(18, 47, 37, .06); margin-bottom: 18px;
}
.shopping-add-form { display: grid; grid-template-columns: 2fr 1.3fr .9fr 2fr auto; gap: 12px; align-items: end; }
.shopping-add-form label, .shopping-edit-form label { display: grid; gap: 5px; color: #094634; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.shopping-add-form input, .shopping-edit-form input { min-width: 0; padding: 11px 12px; border: 1px solid #adc7b7; border-radius: 10px; background: white; font: inherit; }
.shopping-add-form .shopping-remember { grid-column: 1 / -2; display: flex; align-items: center; gap: 7px; text-transform: none; font-weight: 500; }
.shopping-remember input { width: auto; }
.shopping-merchant-group + .shopping-merchant-group { margin-top: 12px; }
.shopping-merchant-group h2 { color: #094634; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 2px; }
.shopping-entry { border-top: 1px solid #e3e5df; }
.shopping-entry:last-child { border-bottom: 1px solid #e3e5df; }
.shopping-entry > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; }
.shopping-entry > summary::-webkit-details-marker { display: none; }
.shopping-check-form { flex: 0 0 auto; }
.shopping-check-form button { width: 28px; height: 28px; border: 1px solid #8eb09d; border-radius: 7px; background: white; color: transparent; cursor: pointer; }
.shopping-check-form button:hover, .shopping-check-form button:focus { color: #fff; background: #078b61; }
.shopping-item-name { flex: 0 1 auto; min-width: 70px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopping-quantity { flex: 0 0 auto; color: #094634; font-weight: 800; }
.shopping-note { flex: 1 1 auto; min-width: 0; color: #66756d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopping-entry.is-completing { opacity: .42; background: #eef0ed; transition: opacity .2s ease, background .2s ease; }
.shopping-entry.is-completing .shopping-item-name,
.shopping-entry.is-completing .shopping-quantity,
.shopping-entry.is-completing .shopping-note { text-decoration: line-through; }
.shopping-entry.is-completing .shopping-edit-form { pointer-events: none; }
.shopping-entry.is-completing .shopping-check-form button { color: white; background: #087f5b; }
.shopping-edit-form { margin: 0 0 12px 38px; display: grid; grid-template-columns: 1.2fr .9fr 2fr auto; gap: 10px; align-items: end; }
.shopping-edit-form .shopping-remember { grid-column: 1 / -2; display: flex; align-items: center; gap: 7px; text-transform: none; font-weight: 500; }
.shopping-add-link { width: 100%; margin-top: 10px; padding: 10px; border: 1px dashed #8eb09d; border-radius: 11px; color: #094634; background: #f2f7f3; cursor: pointer; font-weight: 800; }
.shopping-add-link:hover { background: #e6f1e9; }
.shopping-item-actions { display: flex; gap: 10px; }
.shopping-item-actions .shopping-add-link { min-width: 0; flex: 1; }
.shopping-readd-dialog { max-height: calc(100dvh - 36px); }
.shopping-readd-intro { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 12px 0; }
#shopping-history-search { width: 100%; min-width: 0; margin-bottom: 12px; padding: 11px 12px; border: 1px solid #adc7b7; border-radius: 10px; background: white; }
.shopping-history-list { max-height: 55dvh; overflow-y: auto; }
.shopping-history-entry { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #e3e5df; }
.shopping-history-description { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.shopping-history-description strong, .shopping-history-description small { display: block; }
.shopping-history-description small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.shopping-history-entry button { flex: 0 0 auto; }
.shopping-forget-button { width: 36px; height: 36px; padding: 0; border: 1px solid #e3c7c3; border-radius: 8px; background: #fff4f2; color: #aa3030; font-size: 23px; cursor: pointer; }
.shopping-history-sort { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.shopping-history-sort select { padding: 8px 10px; border: 1px solid #adc7b7; border-radius: 8px; background: white; }
[data-shopping-history-group] { margin: 16px 0 4px; font-size: 13px; color: var(--green); text-transform: uppercase; letter-spacing: .06em; }
.shopping-add-dialog { width: min(760px, calc(100vw - 30px)); padding: 22px; border: 0; border-radius: 18px; color: var(--ink); background: #fffef9; box-shadow: 0 24px 80px rgba(7, 19, 31, .28); }
.shopping-add-dialog::backdrop { background: rgba(7, 19, 31, .58); }
.shopping-dialog-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.shopping-dialog-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 26px; }
.shopping-dialog-heading button { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #7e2c2c; background: #f9e2df; cursor: pointer; font-size: 22px; }
@media (max-width: 760px) {
  .shopping-page { padding: 22px 14px 60px; }
  .shopping-add-dialog { padding: 18px; }
  .shopping-add-form { grid-template-columns: 1fr 1fr; }
  .shopping-item-field, .shopping-note-field { grid-column: 1 / -1; }
  .shopping-add-form .shopping-remember { grid-column: 1 / 2; }
  .shopping-edit-form { grid-template-columns: 1fr 1fr; margin-left: 0; }
  .shopping-edit-form label:first-of-type, .shopping-edit-form label:nth-of-type(3) { grid-column: 1 / -1; }
  .shopping-edit-form .shopping-remember { grid-column: 1 / 2; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar { position: relative; z-index: 30; height: 72px; padding: 0 23px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--navy-950); border-bottom: 1px solid rgba(255,255,255,.1); }
.brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; }
.brand > span { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 19px; letter-spacing: .01em; white-space: nowrap; }
.brand small { margin-top: 2px; color: #aabac6; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.household-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #d8e0e5; font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #42d39a; box-shadow: 0 0 0 4px rgba(66,211,154,.12); }
.message-stack { position: fixed; z-index: 20; top: 84px; right: 18px; width: min(390px, calc(100vw - 36px)); }
.message { margin-bottom: 8px; padding: 13px 15px; border: 1px solid #b8dccd; border-radius: 11px; color: #075a42; background: #e8f8f1; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; transition: opacity .2s ease, transform .2s ease; }
.message.error { border-color: #e8b6b2; color: #8f2929; background: #fff0ee; }
.message.is-hiding { opacity: 0; transform: translateY(-6px); }

.account-menu { position: relative; }
.account-menu-toggle { width: 38px; height: 38px; padding: 0; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #e7eef2; background: rgba(255,255,255,.07); cursor: pointer; }
.account-menu-toggle:hover, .account-menu-toggle:focus-visible { border-color: rgba(255,255,255,.58); background: rgba(255,255,255,.15); outline: none; }
.account-menu-toggle svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.account-menu-popover { position: absolute; z-index: 40; top: calc(100% + 9px); right: 0; width: 190px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.account-menu-user { padding: 5px 8px 9px; border-bottom: 1px solid var(--line); }
.account-menu-user span, .account-menu-user strong { display: block; }
.account-menu-user span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-menu-user strong { margin-top: 3px; color: var(--navy-900); font-size: 13px; overflow-wrap: anywhere; }
.account-menu-signout { margin: 8px 0 0; }
.account-menu-signout button { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-800); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; text-align: left; }
.account-menu-signout button:hover, .account-menu-signout button:focus-visible { border-color: var(--navy-700); background: #edf3f6; outline: none; }
.auth-shell { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 34px 18px 70px; }
.auth-card { width: min(430px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin: 7px 0 8px; font-family: Georgia, serif; font-size: clamp(30px, 7vw, 42px); font-weight: 600; line-height: 1; }
.auth-intro { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.auth-form { display: grid; gap: 16px; }
.auth-form .form-field { display: grid; gap: 6px; }
.auth-form .form-field > span { color: var(--navy-700); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-form input { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.auth-form input:focus { border-color: var(--navy-700); outline: 3px solid rgba(29,72,96,.14); }
.auth-submit { width: 100%; min-height: 44px; margin-top: 4px; }
.auth-secondary-link { justify-self: center; color: var(--navy-700); font-size: 12px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.auth-secondary-link:hover, .auth-secondary-link:focus-visible { color: var(--navy-900); }
.auth-error { margin: 0 0 16px; padding: 11px 12px; border: 1px solid #e8b6b2; border-radius: 10px; color: #8f2929; background: #fff0ee; font-size: 13px; font-weight: 700; }
.auth-notice { margin: 0 0 16px; padding: 11px 12px; border: 1px solid #b8dccd; border-radius: 10px; color: #075a42; background: #e8f8f1; font-size: 13px; font-weight: 700; }

.dashboard-shell { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1fr) 333px; }
.workspace { min-width: 0; grid-column: 1; grid-row: 1; padding: 15px 40px 28px 20px; }
.ledger-panel { min-width: 0; grid-column: 2; grid-row: 1; background: var(--navy-900); color: white; border-left: 1px solid var(--navy-950); height: calc(100vh - 72px); position: sticky; top: 0; display: flex; flex-direction: column; }
.page-heading, .section-heading, .ledger-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1, .section-heading h2, .ledger-heading h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
.page-heading h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.page-heading p { margin: 10px 0 0; color: var(--muted); }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.date-context-banner { margin-bottom: 12px; padding: 12px 14px; border: 1px solid #dfc778; border-radius: 14px; background: #fff6d8; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.date-context-banner.is-today { border-color: #afd6c5; background: #eaf6f0; }
.date-context-banner.is-forecast { border-color: #c8cce4; background: #f0f1fa; }
.date-context-copy { min-width: 250px; }
.date-context-copy .eyebrow { color: var(--navy-700); }
.date-context-title { margin-top: 3px; display: flex; align-items: center; gap: 9px; }
.date-context-title strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 600; }
.date-context-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.date-context-state { padding: 3px 7px; border: 1px solid rgba(29,72,96,.2); border-radius: 999px; color: var(--navy-700); background: rgba(255,255,255,.55); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.date-context-controls { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; }
.return-today-button { min-height: 38px; padding: 9px 11px; border: 1px solid var(--navy-800); border-radius: 9px; color: var(--navy-800); background: rgba(255,255,255,.7); display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; white-space: nowrap; }
.return-today-button:hover { background: white; }
.date-jump { width: 190px; min-width: 0; }
.date-jump label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.date-jump-row { display: flex; }
.date-jump input { min-width: 0; flex: 1; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.date-jump button, .button { padding: 10px 15px; border: 0; border-radius: 0 10px 10px 0; color: white; background: var(--navy-800); cursor: pointer; font-weight: 750; }
.button.primary { display: inline-block; border-radius: 10px; }
.view-switcher { display: flex; align-items: center; gap: 8px; }
.view-switcher .primary-button, .view-switcher .secondary-button { min-height: 38px; padding: 8px 10px; }

.metric-grid { display: grid; grid-template-columns: 1.35fr repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 108px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,247,.72); display: flex; flex-direction: column; justify-content: space-between; }
.metric-card.hero-metric { color: white; background: var(--navy-800); border-color: var(--navy-800); box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.metric-card.hero-metric span, .metric-card.hero-metric small { color: #c5d4dd; }
.metric-card strong { margin: 10px 0 4px; font-family: Georgia, serif; font-size: clamp(23px, 2.15vw, 29px); font-weight: 600; letter-spacing: -.025em; line-height: 1.05; white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric-card.hero-metric strong { font-size: clamp(27px, 2.7vw, 36px); }
.metric-card small { color: var(--muted); }

.section-block { margin-top: 38px; }
.bucket-workspace { margin-top: 18px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2, .ledger-heading h2 { font-size: 25px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.bucket-title-line { display: flex; align-items: center; gap: 12px; }
.bucket-title-line h2 { margin: 0; }
.workspace-title-panel h2 small, .bucket-title-line h2 small { display: block; margin-top: 2px; color: var(--muted); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.bucket-title-line .secondary-button, .bucket-title-line .primary-button { padding: 7px 10px; }
.workspace-control-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.workspace-title-panel { flex: 0 0 auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,247,.76); }
.workspace-title-panel h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 600; }
.workspace-control-bar > .bucket-filter { flex: 1 1 280px; justify-content: center; }
.workspace-control-bar > .transaction-action-group { margin-left: auto; }
.day-detail.section-block { margin-top: 18px; }
.recurring-rule-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 12px 0 8px; font-size: 11px; font-weight: 600; }
.recurring-rule-legend .rule-meta-funding { color: #286aa6; }
.recurring-rule-legend .rule-meta-income { color: #087f5b; }
.recurring-rule-legend .rule-meta-expense { color: #b73737; }
.bucket-control-main { min-width: 0; }
.bucket-groups { display: grid; gap: 26px; }
.bucket-group-title { margin: 0 0 9px; font-size: 12px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.bucket-group-expense .bucket-group-title { color: var(--red); }
.bucket-group-income .bucket-group-title { color: var(--green); }
.bucket-grid { --bucket-column-count: 4; display: grid; grid-template-columns: repeat(var(--bucket-column-count), minmax(0, 1fr)); align-items: start; gap: 12px; overflow-anchor: none; }
.bucket-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.bucket-actions { display: flex; align-items: center; gap: 12px; }
.transaction-action-group { padding: 8px 10px 10px; border: 1px solid #c9d5d9; border-radius: 12px; background: #e8eff0; box-shadow: 0 3px 9px rgba(7,19,31,.04); }
.transaction-action-label { display: block; margin: 0 0 6px 2px; color: var(--navy-700); font-size: 10px; font-weight: 850; letter-spacing: .1em; line-height: 1; text-transform: uppercase; }
.transaction-action-group .primary-button { min-width: 142px; }
.bucket-filter { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.bucket-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.bucket-filter-row > span { min-width: 45px; color: var(--navy-700); font-weight: 850; }
.bucket-filter label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.bucket-filter input { accent-color: var(--navy-800); }
.bucket-category-title { grid-column: 1 / -1; margin: 7px 0 -3px; padding: 7px 10px; border-radius: 7px; background: var(--paper-deep); color: var(--navy-700); font-size: 12px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.bucket-group-toggle { display: flex; align-items: center; gap: 7px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.bucket-group-toggle:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 3px; border-radius: 3px; }
.bucket-group-caret { display: inline-block; transition: transform .15s ease; }
.bucket-group-toggle[aria-expanded="false"] .bucket-group-caret { transform: rotate(-90deg); }
.bucket-card[hidden], .bucket-group-tile-members[hidden] { display: none !important; }
.bucket-group-tile.is-collapsed { min-height: 0; }
.activity-dialog.dashboard-day-dialog { width: min(900px, calc(100vw - 32px)); max-height: 90dvh; overflow-y: auto; padding: 20px; }
.dashboard-day-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dashboard-day-heading h2 { margin: 0; }
.dashboard-day-heading button { font-size: 22px; padding: 3px 12px; }
.dashboard-day-date { margin: 8px 0 16px; font-size: 23px; }
.dashboard-day-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.dashboard-day-totals > div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.dashboard-day-totals span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 750; }
.dashboard-day-totals strong { display: block; margin-top: 5px; font-size: 19px; }
.dashboard-day-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.dashboard-day-section { margin-top: 22px; }
.dashboard-day-section h4 { margin-bottom: 8px; }
.dashboard-day-item-link { display: inline-block; margin-top: 5px; font-size: 12px; text-decoration: underline; }
.activity-dialog.dashboard-day-dialog .transaction-row { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 12px; }
.dashboard-day-section .transaction-row > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.dashboard-day-section .transaction-row > strong { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) { .dashboard-day-totals > div:last-child { grid-column: 1 / -1; } }
.transfer-amount { color: #1769aa; }
.dashboard-refresh-notice { padding: 10px; margin-bottom: 10px; border: 1px solid #d3b75b; border-radius: 8px; background: #fff5d6; color: var(--navy-900); }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 1) { color: #286aa6; background: #e7f1fb; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 2) { color: #6e52a3; background: #f0eafb; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 3) { color: #9a6b00; background: #fff3d6; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 4) { color: #b44b3f; background: #fde9e5; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 5) { color: #16756b; background: #e3f5f2; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 6) { color: #8a4c8d; background: #f7e8f7; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 7) { color: #4f6473; background: #e9eef2; }
.bucket-grid > .bucket-category-title:nth-of-type(8n + 8) { color: #257247; background: #e7f5ec; }
/* Saved group colors take precedence over the positional fallback palette. */
.bucket-grid > .bucket-category-title[data-group-color] { color: var(--navy-700); color: color-mix(in srgb, var(--group-color) 40%, #000); background: linear-gradient(135deg, #fff 0%, var(--group-color) 100%); }
.bucket-group-tiles { --bucket-column-count: 4; display: grid; grid-template-columns: repeat(var(--bucket-column-count), minmax(0, 1fr)); gap: 12px; }
.bucket-group-tile { min-width: 0; min-height: 148px; padding: 15px 16px 13px; display: flex; flex-direction: column; border: 1px solid var(--line); border-top: 4px solid #286aa6; border-radius: 13px; color: var(--ink); background: linear-gradient(135deg, #fff 0%, #e7f1fb 100%); box-shadow: 0 5px 14px rgba(7,19,31,.05); transition: box-shadow .15s ease, transform .15s ease; }
.bucket-group-tile:nth-child(8n + 2) { border-top-color: #6e52a3; background: linear-gradient(135deg, #fff 0%, #f0eafb 100%); }
.bucket-group-tile:nth-child(8n + 3) { border-top-color: #9a6b00; background: linear-gradient(135deg, #fff 0%, #fff3d6 100%); }
.bucket-group-tile:nth-child(8n + 4) { border-top-color: #b44b3f; background: linear-gradient(135deg, #fff 0%, #fde9e5 100%); }
.bucket-group-tile:nth-child(8n + 5) { border-top-color: #16756b; background: linear-gradient(135deg, #fff 0%, #e3f5f2 100%); }
.bucket-group-tile:nth-child(8n + 6) { border-top-color: #8a4c8d; background: linear-gradient(135deg, #fff 0%, #f7e8f7 100%); }
.bucket-group-tile:nth-child(8n + 7) { border-top-color: #4f6473; background: linear-gradient(135deg, #fff 0%, #e9eef2 100%); }
.bucket-group-tile:nth-child(8n + 8) { border-top-color: #257247; background: linear-gradient(135deg, #fff 0%, #e7f5ec 100%); }
.bucket-group-tile[data-group-color] { border-top-color: var(--group-color); background: linear-gradient(135deg, #fff 0%, var(--group-color) 100%); }
.bucket-group-tile:hover { box-shadow: 0 10px 24px rgba(7,19,31,.12); transform: translateY(-1px); }
.bucket-group-tile-label { font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 600; line-height: 1.1; }
.bucket-group-tile-count { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.bucket-group-tile-members { min-height: 0; margin-top: 11px; overflow: visible; color: var(--navy-800); font-size: 12px; line-height: 1.45; }
.bucket-group-tile-member { display: block; overflow-wrap: anywhere; color: inherit; text-decoration: none; }
.bucket-group-tile-member::before { content: "•"; margin-right: 6px; color: var(--navy-700); }
.bucket-group-tile-member:hover, .bucket-group-tile-member:focus-visible { color: var(--navy-700); text-decoration: underline; text-underline-offset: 2px; outline: none; }
.bucket-card { min-height: 102px; padding: 15px 16px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 13px; background: var(--surface); transition: box-shadow .15s ease; }
.bucket-card.bucket-income { border-top-color: var(--green); background: linear-gradient(135deg, #fffdf7 0%, #f1faf5 58%, #e4f5ec 100%); }
.bucket-card.bucket-expense { border-top-color: var(--red); background: linear-gradient(135deg, #fffdf7 0%, #fff4f2 58%, #f9e6e3 100%); }
.bucket-card[data-group-color] { background: linear-gradient(135deg, #fff 0%, var(--group-color) 100%); }
.bucket-card:hover { box-shadow: 0 10px 24px rgba(7,19,31,.08); }
.matching-repayment { grid-column: 1 / -1; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f1faf5; }
.matching-repayment .matching-repayment-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; text-transform: none; letter-spacing: normal; }
.matching-repayment-toggle input { width: auto; accent-color: var(--green); }
.matching-repayment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.matching-repayment-heading > strong { color: var(--green); white-space: nowrap; font-size: 1.15rem; }
.matching-repayment-heading > strong[hidden] { display: none; }
.matching-repayment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.matching-repayment-options[hidden], .matching-repayment[hidden], .matching-repayment-options label[hidden] { display: none; }
.matching-repayment-options label { display: grid; gap: 5px; min-width: 0; font-size: 12px; }
.matching-repayment-options select { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: white; }
.matching-repayment-options small { grid-column: 1 / -1; color: var(--muted); }
.matching-repayment-existing { padding: 12px; background: #f1faf5; border-radius: 9px; }
.matching-repayment-action { flex-basis: 100%; width: 100%; margin-top: 10px; }
.duplicate-decision-form .matching-repayment, .matching-repayment-decision-hint { flex-basis: 100%; width: 100%; }
@media (max-width: 640px) { .matching-repayment-options { grid-template-columns: 1fr; } }
.bucket-card.is-negative { border-top-color: var(--red); }
.bucket-card.is-inactive { border-top-color: #929b9f; background: linear-gradient(135deg, #faf9f4 0%, #f0f1ee 100%); }
.bucket-card.is-inactive h3, .bucket-card.is-inactive .balance-pill { opacity: .7; }
.ledger-income-category { color: #286aa6; background: #e7f1fb; }
.ledger-income-card { border-top-color: #286aa6; background: linear-gradient(135deg, #fffdf7 0%, #f3f7fc 58%, #e6f0fb 100%); }
.ledger-income-card h3, .ledger-income-card .bucket-kind { color: #286aa6; }
.ledger-income-card .balance-pill.positive-bg { background: #286aa6; }
.ledger-income-card .rule-count-income { color: #286aa6; background: #e7f1fb; }
.bucket-card.is-open { min-height: 280px; }
.bucket-mini-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.bucket-mini-copy { min-width: 0; flex: 1 1 0; }
.bucket-mini-actions { display: flex; align-items: center; gap: 7px; }
.bucket-activity-icon { width: 26px; height: 26px; flex: 0 0 26px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; border: 1px solid currentColor; border-radius: 50%; }
.bucket-activity-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.1; }
.bucket-activity-icon-transfer-in, .bucket-activity-icon-transfer-out { color: #286aa6; background: #e7f1fb; }
.bucket-activity-icon-income { color: #087f5b; background: #e4f5ed; }
.bucket-activity-icon-expense { color: #b73737; background: #fbe9e7; }
.bucket-status-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 11px; }
.schedule-status { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 850; line-height: 1.2; white-space: nowrap; }
.schedule-status button, button.schedule-status { cursor: pointer; }
.bucket-status-row a.schedule-status { text-decoration: none; }
.bucket-status-row a.schedule-status:hover, .bucket-status-row a.schedule-status:focus-visible { filter: brightness(.96); outline: 2px solid rgba(18,57,77,.2); outline-offset: 1px; }
.bucket-transactions-link { width: 84px; min-height: 24px; justify-content: center; justify-self: start; box-sizing: border-box; color: var(--navy-700); border-color: #b8c9cf; background: #edf3f4; }
.bucket-edit-link { width: 84px; min-height: 24px; justify-content: center; justify-self: center; box-sizing: border-box; color: #63522d; border-color: #d5c59e; background: #fbf5e6; }
.ledger-schedules-label { width: auto; }
.rule-count-group { display: flex; align-items: center; justify-self: end; gap: 5px; }
.bucket-status-row > .rule-count-bubble { justify-self: end; }
.rule-count-bubble { min-width: 27px; height: 24px; padding: 0 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; font-weight: 900; line-height: 1; cursor: pointer; font-variant-numeric: tabular-nums; }
.rule-count-bubble:hover, .rule-count-bubble:focus-visible, .rule-count-bubble[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 1px; filter: brightness(.96); }
.rule-count-funding { color: #286aa6; background: #e7f1fb; }
.rule-count-income { color: #087f5b; background: #e4f5ed; }
.rule-count-expense { color: #b73737; background: #fbe9e7; }
.schedule-status-light { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.schedule-status-active { color: #17643f; border-color: #a9d7bd; background: #e8f5ed; }
.schedule-status-pending { color: #39765a; border-color: #c7dfd1; background: #f0f8f3; }
.schedule-status-warning { color: #7b5700; border-color: #e2c367; background: #fff3c8; }
.schedule-status-ended { color: #98382f; border-color: #e1aaa5; background: #fbe9e7; }
.schedule-status-manual { color: #5f6870; border-color: #cfd4d7; background: #f1f3f4; }
.duplicate-flag { padding: 4px 7px; border: 1px solid #d6ad43; border-radius: 999px; color: #76560b; background: #fff5cf; font-size: 10px; font-weight: 850; line-height: 1; text-decoration: none; white-space: nowrap; }
.duplicate-flag:hover, .duplicate-flag:focus-visible { background: #ffeaa2; outline: 2px solid rgba(214,173,67,.28); outline-offset: 1px; }
.bucket-kind { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.bucket-inactive-marker { color: #8a3d38; }
.balance-pill { padding: 6px 9px; border: 0; border-radius: 999px; color: white; font-size: 12px; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums; }
.balance-pill:hover, .balance-pill:focus-visible { outline: 3px solid rgba(225,168,59,.35); outline-offset: 2px; }
.bucket-card h3 { margin: 6px 0 0; overflow: hidden; color: var(--ink); font-family: Georgia, serif; font-size: 20px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.bucket-toggle { width: 30px; height: 30px; flex: 0 0 30px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-700); background: transparent; cursor: pointer; }
.caret { width: 8px; height: 8px; display: block; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transform-origin: center; transition: transform .15s ease; font-size: 0; }
.bucket-toggle[aria-expanded="true"] .caret { transform: rotate(225deg); }
.bucket-expanded { margin-top: 15px; padding-top: 14px; border-top: 1px solid #ebe9e1; }
.bucket-plan { margin: 0; display: grid; grid-template-columns: 1fr; }
.bucket-plan div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f0eee8; }
.bucket-plan dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.bucket-plan dd { margin: 0; font-size: 11px; font-weight: 800; text-align: right; }
.bucket-daily-summary > div { align-items: baseline; }
.bucket-daily-summary dt { flex: 1; min-width: 0; text-align: left; text-transform: none; }
.bucket-daily-summary dd { flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bucket-summary-footer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 12px; margin-top: 6px; }
.bucket-summary-footer small { color: var(--muted); font-size: 10px; }
.bucket-summary-footer a { margin-left: auto; font-size: 11px; font-weight: 750; white-space: nowrap; }
.bucket-plan-empty { min-height: 70px; padding-top: 18px; color: var(--muted); font-size: 12px; }
.day-detail { margin-top: 34px; }
.day-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.activity-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 90px rgba(7,19,31,.34); }
.activity-dialog::backdrop { background: rgba(7,19,31,.62); backdrop-filter: blur(2px); }
.activity-form { position: relative; padding: 27px; }
.activity-form h2 { margin: 6px 0 5px; font-family: Georgia, serif; font-size: 28px; }
.activity-form > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; font-size: 22px; line-height: 1; }

.ledger-heading { padding: 20px 18px 14px; align-items: flex-end; gap: 12px; }
.ledger-heading h2 { white-space: nowrap; }
.ledger-heading h2 small { display: block; margin-top: 3px; color: #b6c5ce; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .04em; line-height: 1.2; }
.ledger-heading > div { min-width: 0; }
.ledger-heading .eyebrow { color: #70d9b5; }
.ledger-heading-main { display: flex; align-items: flex-start; flex-direction: column; }
.ledger-heading-main .range-label { margin-top: 7px; }
.ledger-heading-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ledger-shortcut { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; color: #dce8ee; font-size: 11px; font-weight: 800; text-decoration: none; }
.ledger-shortcut:hover, .ledger-shortcut:focus-visible { background: rgba(255,255,255,.1); color: white; }
.ledger-schedules-button { flex: 0 0 auto; white-space: nowrap; }
.range-label { padding: 5px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; color: #b6c5ce; font-size: 11px; white-space: nowrap; }
.ledger-columns { padding: 8px 18px; display: grid; grid-template-columns: 1.2fr .85fr 1fr; color: #8195a3; background: rgba(0,0,0,.12); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ledger-columns span:not(:first-child) { text-align: right; }
.ledger-scroll { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; overflow-anchor: none; padding: 7px 10px 18px; scroll-behavior: auto; }
.ledger-row { min-height: 50px; padding: 7px 9px; display: grid; grid-template-columns: 1.2fr .85fr 1fr; align-items: center; border-left: 3px solid transparent; border-bottom: 1px solid rgba(255,255,255,.055); border-radius: 7px; font-variant-numeric: tabular-nums; }
.ledger-row:hover { background: rgba(255,255,255,.05); }
.ledger-row.selected { background: #030a10; border-left-color: var(--gold); }
.ledger-row.today:not(.selected) { border-left-color: #86a6b9; }
.ledger-row.unavailable { color: #708491; cursor: default; opacity: .62; }
.ledger-row.unavailable:hover { background: transparent; }
.ledger-row > span:not(:first-child) { text-align: right; font-size: 13px; font-weight: 750; }
.ledger-row strong, .ledger-row small { display: block; }
.ledger-row strong { font-size: 13px; }
.ledger-row small { margin-top: 2px; color: #8296a3; font-size: 10px; }
.ledger-date-income { color: #67d6ac; }
.ledger-date-expense { color: #ff7d78; }
.ledger-date-both { color: #f0c65b; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.ledger-panel .positive { color: #67d6ac; }
.ledger-panel .negative { color: #ff7d78; }
.positive-bg { background: var(--green); }
.negative-bg { background: var(--red); }
.inline-empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.action-grid { margin-top: 34px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 14px; }
.quick-entry, .recent-panel, .detail-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-heading.compact { align-items: center; margin-bottom: 18px; }
.section-heading.compact h2 { font-size: 22px; }
.quick-form { display: grid; gap: 13px; }
.quick-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.quick-form input, .quick-form select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 14px; text-transform: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money-input { display: flex; align-items: center; gap: 7px; padding-left: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 14px; }
.money-input input { padding-left: 0; border: 0; }
.money-input.amount-income { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.money-input.amount-expense { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.money-input.amount-income input { color: var(--green); background: transparent; }
.money-input.amount-expense input { color: var(--red); background: transparent; }
.submit-button { padding: 12px 16px; border: 0; border-radius: 10px; color: white; background: var(--navy-800); cursor: pointer; font-weight: 800; }
.submit-button:hover { background: var(--navy-700); }
.submit-button:disabled,
.submit-button.is-submitting { background: #8a9498; color: #f4f6f5; cursor: wait; opacity: 1; }
button.is-submitting,
button.is-submitting:hover,
button.is-submitting:focus-visible,
button.is-submitting:disabled { border-color: #8a9498; color: #f4f6f5; background: #8a9498; cursor: wait; opacity: 1; }
.form-hint { margin: -4px 0 0; color: var(--muted); font-size: 11px; }
.bucket-deactivation-warning { margin: 12px 0; padding: 11px 13px; display: grid; gap: 3px; border: 1px solid #e1bd68; border-radius: 9px; color: #704800; background: #fff6d9; font-size: 12px; line-height: 1.4; }
.bucket-deactivation-warning strong, .bucket-deactivation-warning span { display: block; }
.form-errors, .errorlist { margin: 0; padding: 9px 12px; border-radius: 8px; color: #8f2929; background: var(--red-soft); font-size: 12px; list-style: none; }
.recent-list, .transaction-list { display: grid; }
.recent-row, .transaction-row { min-height: 57px; padding: 10px 3px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #ebe9e1; }
.recent-row:last-child, .transaction-row:last-child { border-bottom: 0; }
.recent-row:hover strong:first-child { color: var(--green); }
.recent-row strong, .recent-row small, .transaction-row strong, .transaction-row small { display: block; }
.transaction-row > span:first-child { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.bucket-history-row small, .bank-import-match-box small { overflow-wrap: anywhere; }
.bank-import-match-box small { display: block; margin-top: 4px; }
@media (max-width: 640px) {
  .transaction-row { flex-wrap: wrap; gap: 6px; }
  .transaction-row > span:first-child { flex: 1 1 100%; }
  .transaction-row > .transaction-actions { margin-left: auto; }
}
.recent-row small, .transaction-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.transaction-row small.rule-meta-funding { color: #286aa6; }
.transaction-row small.rule-meta-income { color: #087f5b; }
.transaction-row small.rule-meta-expense { color: #b73737; }
.transaction-row small.transaction-meta-funding { color: #286aa6; }
.transaction-row small.transaction-meta-income { color: #087f5b; }
.transaction-row small.transaction-meta-expense { color: #b73737; }
.recent-row > span:last-child { font-weight: 800; font-variant-numeric: tabular-nums; }

.detail-shell { max-width: 1180px; margin: 0 auto; padding: 34px; }
.back-link { display: inline-block; margin-bottom: 25px; color: var(--navy-700); font-size: 13px; font-weight: 750; }
.detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.detail-heading h1 { margin: 5px 0 6px; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 54px); font-weight: 600; }
.detail-heading p { margin: 0; color: var(--muted); }
.detail-metrics { display: flex; align-items: stretch; gap: 12px; }
.detail-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 9px; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 9px; font-size: 12px; font-weight: 800; text-decoration: none; }
.primary-button { border: 1px solid var(--navy-800); color: white; background: var(--navy-800); cursor: pointer; }
.primary-button:hover { background: var(--navy-700); }
.secondary-button { border: 1px solid var(--line); color: var(--navy-700); background: var(--surface); }
.danger-button { border: 1px solid var(--red); color: white; background: var(--red); cursor: pointer; }
.danger-button:hover { filter: brightness(.9); }
.detail-balance { min-width: 220px; padding: 18px 22px; border-left: 4px solid var(--green); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.detail-balance.is-negative { border-left-color: var(--red); }
.detail-balance span, .detail-balance strong { display: block; }
.detail-balance span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-balance strong { margin-top: 5px; font-family: Georgia, serif; font-size: 31px; }
.detail-balance small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.detail-balance.spending-forecast { border-left-color: var(--gold); }
.detail-balance .budget-comparison { font-weight: 800; }
.detail-balance .budget-comparison.over-budget { color: var(--red); }
.detail-balance .budget-comparison.under-budget { color: var(--green); }
.bucket-spend-summary { min-width: 410px; padding: 14px 18px; border-left: 4px solid var(--gold); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.bucket-spend-summary > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.bucket-spend-summary-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bucket-spend-summary-values div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.bucket-spend-summary-values strong, .bucket-spend-summary-values small { display: block; white-space: nowrap; }
.bucket-spend-summary-values strong { color: var(--red); font-family: Georgia, serif; font-size: 21px; }
.bucket-spend-summary-values small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 750; }
.bucket-spend-summary-note { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.bucket-activity-summary { min-width: 410px; padding: 10px 12px; border-left: 4px solid #286aa6; border-radius: 10px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.bucket-activity-summary-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.bucket-activity-summary-title > span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.bucket-activity-summary-title > small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.bucket-activity-summary-grid { display: grid; gap: 1px; }
.bucket-activity-summary-row { display: grid; grid-template-columns: 1.1fr repeat(4, minmax(0, 1fr)); align-items: center; gap: 7px; min-height: 18px; }
.bucket-activity-summary-row > span, .bucket-activity-summary-row > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-activity-summary-row > span { font-size: 10px; font-weight: 800; }
.bucket-activity-summary-row > strong { font-family: Georgia, serif; font-size: 12px; font-weight: 600; text-align: right; }
.bucket-activity-summary-header { min-height: 15px; color: var(--muted); }
.bucket-activity-summary-header > span { font-size: 8px; font-weight: 850; letter-spacing: .05em; text-align: right; text-transform: uppercase; }
.bucket-activity-summary-header > span:first-child { text-align: left; }
.activity-summary-expense { color: var(--red); }
.activity-summary-income { color: var(--green); }
.activity-summary-transfer { color: #286aa6; }
.report-bucket-activity-summary { min-width: 420px; padding: 9px 12px; box-shadow: none; }
.report-bucket-activity-summary .bucket-activity-summary-title { margin-bottom: 4px; }
.spending-review-card { margin-top: 22px; border-color: #e5c369; background: #fff9e8; }
.spending-review-intro { margin: -7px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.history-grid .detail-card { min-width: 0; }
.all-transactions-card { margin-top: 28px; }
.definition-list { margin: 18px 0 0; }
.definition-list div { padding: 12px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ebe9e1; }
.definition-list dt { color: var(--muted); font-size: 12px; }
.definition-list dd { margin: 0; font-size: 13px; font-weight: 800; text-align: right; }
.transaction-actions { display: flex; align-items: center; gap: 12px; text-align: right; }
.transaction-actions form { margin: 0; }
.text-button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--red); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.edit-text-button { color: var(--navy-700); text-decoration: none; }
.muted-row { opacity: .52; }
.transaction-block { border-bottom: 1px solid #ebe9e1; }
.transaction-block:last-child { border-bottom: 0; }
.transaction-block > .transaction-row { border-bottom: 0; }
.duplicate-review { margin: 0 3px 11px; border: 1px solid #e5c369; border-radius: 9px; background: #fff9e8; }
.duplicate-review summary { padding: 9px 11px; display: flex; justify-content: space-between; gap: 10px; color: #76560b; cursor: pointer; font-size: 12px; font-weight: 800; }
.duplicate-summary-content { min-width: 0; overflow-wrap: anywhere; }
.duplicate-summary-date { display: block; margin-bottom: 7px; color: var(--navy-700); font-size: 14px; }
.duplicate-summary-entry { display: block; margin-bottom: 7px; color: var(--navy-700); font-weight: 500; line-height: 1.4; }
.duplicate-summary-entry small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.duplicate-summary-control { flex-shrink: 0; align-self: flex-start; }
.duplicate-compare { padding: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid #ead99d; }
.duplicate-compare > div { padding: 10px; border-radius: 8px; background: rgba(255,255,255,.72); }
.duplicate-compare span, .duplicate-compare small { display: block; margin-top: 3px; }
.duplicate-compare small, .duplicate-reason { color: var(--muted); font-size: 11px; }
.duplicate-reason { margin: 0; padding: 0 11px 10px; }
.duplicate-actions { padding: 0 11px 11px; display: flex; justify-content: flex-end; gap: 8px; }
.duplicate-actions form { margin: 0; }
.duplicate-actions { flex-wrap: wrap; }
.duplicate-decision-form { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.duplicate-decision-form label { font-size: 12px; font-weight: 750; }
.duplicate-decision-form select { width: auto; min-width: 145px; margin: 0; padding: 7px 9px; }
.duplicate-decision-help { flex-basis: 100%; color: var(--muted); font-size: 11px; }
.duplicate-actions .secondary-button, .duplicate-actions .danger-button { padding: 7px 10px; }
.correction-notice { margin-top: 20px; padding: 12px 14px; border-radius: 9px; background: var(--paper-deep); color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty-shell { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 30px; }
.empty-card { max-width: 560px; padding: 44px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.empty-card h1 { margin: 8px 0 14px; font-family: Georgia, serif; font-size: 38px; }
.empty-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.65; }
.empty-card.error-card { border-top: 4px solid var(--red); }
.form-shell { max-width: 900px; }
.bucket-form { margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-change-button { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--navy-700); background: var(--surface); font: inherit; letter-spacing: 0; text-transform: none; cursor: pointer; }
.form-field input, .form-field select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 14px; text-transform: none; }
.form-field input[readonly] { color: var(--muted); background: #efeee8; cursor: default; }
.checkbox-field { grid-template-columns: auto 1fr; align-items: start; padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); cursor: pointer; }
.checkbox-field input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--navy-800); cursor: pointer; }
.checkbox-field span, .checkbox-field strong, .checkbox-field small { display: block; }
.checkbox-field strong { font-size: 13px; letter-spacing: 0; text-transform: none; }
.checkbox-field small { margin-top: 3px; color: var(--muted); }
.form-field input:disabled, .form-field select:disabled { color: var(--muted); background: #efeee8; }
.form-field small { line-height: 1.4; font-weight: 500; letter-spacing: 0; text-transform: none; }
.form-field .field-error { color: var(--red); font-weight: 700; }
.schedule-guidance { margin: -2px 0 2px; padding: 12px 14px; border-radius: 9px; background: var(--paper-deep); color: var(--muted); font-size: 13px; line-height: 1.45; }
.amount-preview { margin: -2px 0 2px; padding: 12px 14px; border: 1px solid #bad8ca; border-radius: 9px; background: #edf8f2; color: #195c3c; font-size: 14px; font-weight: 750; line-height: 1.45; }
.wide-field { grid-column: 1 / -1; }
.form-actions { margin-top: 24px; display: flex; gap: 10px; }
.edit-delete-row { margin-top: 30px; padding-top: 18px; display: flex; justify-content: flex-end; border-top: 1px solid #ebe9e1; }
.delete-card { margin-top: 28px; border-top: 4px solid var(--red); }
.delete-card h1 { margin: 7px 0 10px; font-family: Georgia, serif; font-size: clamp(32px, 5vw, 48px); }
.delete-card > p { color: var(--muted); line-height: 1.6; }
.danger-text { color: var(--red); }
.delete-impact { margin: 20px 0; padding: 17px 20px 17px 38px; border-radius: 10px; background: #fff2f0; line-height: 1.7; }
.delete-form { max-width: 560px; margin-top: 24px; }
.delete-blocked { margin-top: 22px; padding: 15px 17px; border: 1px solid #e3a39b; border-radius: 10px; color: #8b2e27; background: #fff2f0; font-weight: 700; line-height: 1.5; }
.data-shell { max-width: 1180px; }
.admin-layout { margin-top: 28px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-sidebar { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.admin-nav-group + .admin-nav-group { margin-top: 20px; padding-top: 18px; border-top: 1px solid #ebe9e1; }
.admin-nav-group h2 { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.admin-nav-button { width: 100%; min-height: 37px; margin-top: 5px; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid transparent; border-radius: 8px; color: var(--navy-700); background: transparent; font-size: 12px; font-weight: 800; text-decoration: none; }
.admin-nav-button:hover { border-color: var(--line); background: var(--paper-deep); }
.admin-nav-button.is-active { border-color: var(--navy-800); color: white; background: var(--navy-800); }
.admin-nav-button.danger-nav-button:not(.is-active) { color: var(--red); }
.admin-nav-count { min-width: 22px; padding: 2px 6px; border-radius: 999px; color: white; background: var(--red); text-align: center; font-size: 10px; line-height: 1.4; }
.admin-nav-button.is-active .admin-nav-count { color: var(--red); background: white; }
.admin-content { min-width: 0; scroll-margin-top: 12px; }
.admin-panel { min-height: 330px; }
.admin-panel h2 { margin: 6px 0 9px; font-family: Georgia, serif; font-size: 30px; }
.admin-panel > p { color: var(--muted); line-height: 1.6; }
.admin-panel-actions { margin-top: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-panel-actions form { margin: 0; }
.browser-setup-list { display: grid; gap: 8px; margin-top: 16px; }
.browser-setup { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.browser-setup > summary { padding: 14px 16px; cursor: pointer; font-weight: 800; color: var(--navy-700); }
.browser-setup-content { padding: 0 16px 14px; font-size: 14px; line-height: 1.6; }
.browser-setup-content p { margin-bottom: 0; color: var(--muted); }
.browser-setup-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.browser-setup-links code { overflow-wrap: anywhere; font-size: 12px; }
.browser-setup-links a { font-size: 12px; font-weight: 700; }
.browser-shortcut-status { font-size: 13px; overflow-wrap: anywhere; }
.card-import-sign-in-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.section-heading.compact .admin-panel-actions { margin-top: 0; justify-content: flex-end; }
.user-management-list { margin-top: 22px; display: grid; gap: 9px; }
.user-management-row { padding: 14px; display: grid; grid-template-columns: minmax(130px, .8fr) minmax(210px, 1.3fr) auto; align-items: end; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-deep); }
.user-management-row .form-field { min-width: 0; }
.user-email-field { grid-column: 1 / -1; }
.user-access-badge { grid-column: 1 / span 2; align-self: center; padding: 5px 0; color: #17643f; font-size: 10px; font-weight: 850; white-space: nowrap; }
.password-toggle-button { align-self: end; width: 76px; min-height: 39px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-700); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 800; }
.password-toggle-button:hover, .password-toggle-button:focus-visible { border-color: var(--navy-700); }
.user-save-button { grid-column: 3; align-self: center; justify-self: end; white-space: nowrap; }
.user-add-button { margin-top: 14px; }
.user-management-new-row { margin-top: 10px; border-color: #aac8d6; background: #f2f8fa; }
.bucket-category-create-form { margin: 22px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; }
.bucket-category-admin-list { display: grid; gap: 8px; }
.bucket-category-admin-row { display: flex; align-items: end; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-deep); }
.bucket-category-rename-form { min-width: 0; flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: end; gap: 10px; }
.bucket-category-admin-row > form:last-child { margin: 0 0 6px; }
.bucket-category-count { padding-bottom: 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.transfer-route-hint { margin: 0; padding: 9px 11px; border-left: 3px solid #286aa6; border-radius: 6px; color: #286aa6; background: #e7f1fb; font-size: 12px; font-weight: 800; }
.category-color-picker { position: relative; align-self: end; padding-bottom: 4px; }
.category-color-button { width: 28px; height: 28px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.category-color-button span, .category-color-option { display: block; width: 20px !important; min-width: 20px; height: 20px !important; min-height: 20px; border: 1px solid rgba(7,19,31,.18); border-radius: 4px; background: var(--category-color, #dbeafe) !important; appearance: none; }
.category-color-menu { position: absolute; z-index: 20; top: calc(100% - 1px); right: 0; display: grid; grid-template-columns: 1fr; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 18px rgba(7,19,31,.16); }
.category-color-menu[hidden] { display: none !important; }
.category-color-option { padding: 0; cursor: pointer; }
.category-color-option:hover, .category-color-option:focus-visible { outline: 2px solid var(--navy-800); outline-offset: 1px; }
.admin-record-count { color: var(--muted); font-size: 11px; font-weight: 800; }
.mailbox-panel { min-height: 500px; }
.login-log-panel { min-height: 500px; }
.activity-event-row > span { min-width: 0; }
.activity-event-row strong { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.activity-event-level { display: inline-block; margin-bottom: 6px; padding: 3px 8px; border-radius: 6px; color: var(--navy-800); background: #e8f1fa; font-size: 11px; font-weight: 700; }
.activity-event-success { color: var(--green); background: #e8f8f1; }
.activity-event-warning { color: #9a5c06; background: #fff3d8; }
.activity-event-error { color: var(--red); background: #ffeded; }
.session-expire-form { margin-top: 18px; }
.login-event-row small { overflow-wrap: anywhere; }
.login-event-success { color: var(--green); }
.login-event-failure { color: var(--red); }
.receipt-learning-panel { border-top: 4px solid var(--gold); }
.android-download-panel { border-top: 4px solid var(--gold); }
.reset-panel { border-top: 4px solid var(--red); }
.data-management-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.data-management-grid h2, .reset-callout h2 { margin: 6px 0 9px; font-family: Georgia, serif; font-size: 26px; }
.data-management-grid p, .reset-callout p { color: var(--muted); line-height: 1.55; }
.data-form { margin-top: 20px; display: grid; gap: 14px; }
.data-section-heading { margin-top: 28px; }
.data-section-heading h2 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 28px; }
.receipt-learning-grid { margin-top: 12px; }
.receipt-learning-grid .detail-card { border-top: 4px solid var(--gold); }
.receipt-learning-grid .learning-count { padding: 10px 12px; border-radius: 9px; background: var(--paper-deep); font-size: 13px; }
.receipt-learning-grid .learning-count strong { color: var(--ink); }
.reset-callout { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 4px solid var(--red); }
.deployment-callout { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 30px; border-top: 4px solid var(--green); }
.deployment-callout h2 { margin: 6px 0 9px; font-family: Georgia, serif; font-size: 26px; }
.deployment-callout p { max-width: 780px; color: var(--muted); line-height: 1.55; }
.installer-meta { margin-bottom: 8px; font-size: 13px; }
.installer-meta strong { color: var(--ink); }
.installer-privacy { margin-bottom: 0; font-size: 12px; }
.installer-actions { min-width: 205px; display: grid; justify-items: stretch; gap: 10px; }
.installer-actions form { margin: 0; }
.installer-actions button, .installer-actions a { width: 100%; text-align: center; }
.installer-status { justify-self: end; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.installer-status.current { color: #075a42; background: var(--green-soft); }
.installer-status.stale { color: #8f2929; background: var(--red-soft); }
.android-download-callout { border-top-color: var(--gold); }
.installer-action-note { margin: 0; max-width: 220px; text-align: right; font-size: 12px; }
.top-actions { margin-left: 28px; display: flex; align-items: center; gap: 16px; }
.top-actions > a { color: #d9e5e9; font-size: 12px; font-weight: 800; }
.top-actions form { margin: 0; }
.mail-poll-button { min-height: 34px; padding: 7px 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #e7eff3; background: rgba(255,255,255,.07); cursor: pointer; font-size: 12px; font-weight: 800; line-height: 1; text-align: center; white-space: nowrap; }
.mail-poll-button:hover, .mail-poll-button:focus-visible { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.13); }
.mail-poll-button .admin-nav-count { margin-left: 6px; }
.reports-shell { max-width: 1180px; }
.report-heading-actions { margin-top: 0; flex-wrap: wrap; }
.report-heading-side { display: flex; align-items: flex-end; justify-content: flex-end; gap: 14px; }
.report-bucket-spend-summary { min-width: 360px; padding: 10px 14px; box-shadow: none; }
.report-bucket-spend-summary > span { margin-bottom: 5px; }
.report-bucket-spend-summary .bucket-spend-summary-note { margin-top: 5px; }
.transaction-report-card { min-height: 520px; }
.transaction-search { margin-bottom: 18px; }
.transaction-search > label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.transaction-search-controls { display: flex; align-items: stretch; gap: 8px; }
.transaction-search-controls input[type="search"] { min-width: 0; flex: 1 1 auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 14px; }
.transaction-search-controls select { flex: 0 0 170px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 14px; }
.transaction-history-checkbox { min-height: 39px; padding: 8px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.transaction-history-checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy-800); }
.activity-type-filter { min-width: 0; margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.activity-type-filter legend { padding: 0 5px; color: var(--navy-700); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.activity-type-filter label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.activity-type-filter .activity-filter-funding { color: #286aa6; }
.activity-type-filter .activity-filter-income { color: #087f5b; }
.activity-type-filter .activity-filter-expense { color: #b73737; }
.activity-type-filter input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--navy-800); }
.transaction-history-filter { margin-bottom: 18px; padding: 14px; border: 1px solid #ebe9e1; border-radius: 12px; background: rgba(248,247,242,.72); display: grid; gap: 12px; }
.transaction-filter-scope { display: grid; grid-template-columns: 1.3fr repeat(2, 1fr) 1.2fr; gap: 10px; }
.transaction-filter-scope.is-compact { grid-template-columns: minmax(180px, 240px); }
.transaction-filter-scope label, .transaction-filter-search { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.transaction-filter-scope input, .transaction-filter-scope select, .transaction-filter-search input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 14px; font-weight: 400; letter-spacing: normal; text-transform: none; }
.transaction-filter-options { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.transaction-filter-options .activity-type-filter { margin: 0; }
.transaction-filter-actions { display: flex; align-items: center; gap: 8px; }
.transaction-filter-actions .primary-button, .transaction-filter-actions .secondary-button { min-width: 116px; text-align: center; }
.transaction-filter-actions.transaction-filter-actions-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); justify-content: end; gap: 8px; }
.transaction-filter-actions-compact .primary-button, .transaction-filter-actions-compact .secondary-button { width: 100%; min-width: 0; }
.transaction-record-shortcut { width: 100%; margin: -4px 0 18px; text-align: center; }
.report-search-summary-row { margin: 3px 0 12px; padding-top: 16px; display: flex; align-items: flex-end; gap: 28px; border-top: 1px solid #ebe9e1; }
.report-search-summary-row.is-summary-only { justify-content: flex-end; }
.report-search-summary-row .transaction-search { min-width: 0; margin-bottom: 0; flex: 1 1 auto; }
.report-spend-summary { min-width: 190px; padding: 0 5px 2px; }
.report-spend-summary span, .report-spend-summary strong, .report-spend-summary small, .report-spend-summary a { display: block; }
.report-spend-summary span { color: var(--ink); font-size: 12px; font-weight: 850; }
.report-spend-summary strong { margin-top: 3px; color: var(--red); font-family: Georgia, serif; font-size: 24px; }
.report-spend-summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.report-spend-summary .report-spend-review { margin-top: 2px; color: #9a6500; font-size: 10px; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.report-spend-summary .report-spend-review:hover, .report-spend-summary .report-spend-review:focus-visible { color: #704800; }
.reports-layout { margin-top: 24px; }
.reports-layout-standalone { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
.report-panel-heading { margin-bottom: 20px; align-items: flex-start; }
.report-panel-heading h1, .report-panel-heading h2, .report-chart-panel h2 { margin: 5px 0 7px; font-family: Georgia, serif; font-size: 29px; }
.report-panel-heading p, .report-chart-panel > p { margin: 0; color: var(--muted); line-height: 1.5; }
.report-chart-panel { min-height: 520px; }
.chart-filter { margin-top: 22px; padding-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(150px, 220px)) auto; gap: 10px; align-items: end; border-top: 1px solid #ebe9e1; }
.chart-filter.has-safe-balance { grid-template-columns: repeat(3, minmax(135px, 200px)) auto; }
.chart-filter label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.chart-filter input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.chart-presets { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.chart-presets a { padding: 5px 8px; border: 1px solid #cbd5d8; border-radius: 999px; color: var(--navy-700); background: #f3f7f7; font-size: 10px; font-weight: 800; }
.chart-presets a:hover, .chart-presets a:focus-visible { border-color: var(--navy-700); outline: none; }
.chart-review-notice { margin-top: 14px; padding: 9px 11px; display: block; border: 1px solid #e5c680; border-radius: 8px; color: #704800; background: #fff8e7; font-size: 11px; font-weight: 800; }
.chart-return-link { margin-top: 17px; display: inline-flex; color: var(--navy-700); font-size: 12px; font-weight: 850; }
.chart-return-link:hover, .chart-return-link:focus-visible { text-decoration: underline; }
.chart-total { margin-top: 22px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.chart-total span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.chart-total strong { font-family: Georgia, serif; font-size: 25px; }
.donut-chart-layout { margin-top: 28px; display: grid; grid-template-columns: minmax(210px, 300px) minmax(0, 1fr); gap: 34px; align-items: center; }
.donut-chart { width: min(100%, 280px); aspect-ratio: 1; justify-self: center; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(7,19,31,.08); }
.donut-chart > div { width: 58%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 50%; color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px rgba(7,19,31,.06); text-align: center; }
.donut-chart strong { font-family: Georgia, serif; font-size: clamp(20px, 2.3vw, 29px); }
.donut-chart span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.chart-legend { display: grid; gap: 3px; }
.chart-legend > div { min-height: 38px; padding: 7px 4px; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid #ebe9e1; }
.chart-legend strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend > div > span:last-child { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-swatch { width: 10px; height: 10px; border-radius: 3px; }
.horizontal-bar-chart { margin-top: 16px; display: grid; gap: 13px; }
.horizontal-bar-row { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr); align-items: center; gap: 14px; }
.horizontal-bar-label { min-width: 0; display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.horizontal-bar-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-bar-label span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.horizontal-bar-track { height: 18px; overflow: hidden; border-radius: 5px; background: #e8e7e1; }
.horizontal-bar-track span { min-width: 2px; height: 100%; display: block; border-radius: inherit; }
.vertical-chart-scroll { margin-top: 18px; padding: 12px 4px 3px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.vertical-bar-chart { min-width: max(100%, calc(var(--trend-items, 12) * 56px)); height: 295px; display: flex; align-items: flex-end; gap: 8px; }
.vertical-bar-item { width: 50px; min-width: 50px; height: 100%; display: grid; grid-template-rows: 22px 1fr 37px; text-align: center; }
.vertical-bar-item { border-radius: 6px; text-decoration: none; transition: background .15s ease, transform .15s ease; cursor: pointer; }
.vertical-bar-item:hover, .vertical-bar-item:focus-visible { background: #f1eee3; outline: 2px solid rgba(18,57,77,.18); outline-offset: 1px; transform: translateY(-2px); }
.vertical-bar-item:hover .vertical-bar-column span, .vertical-bar-item:focus-visible .vertical-bar-column span { background: var(--gold); }
.vertical-bar-value { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.vertical-bar-column { min-height: 0; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #c8c8c1; }
.vertical-bar-column span { width: 30px; min-height: 2px; display: block; border-radius: 5px 5px 0 0; background: var(--green); }
.vertical-bar-item small { padding-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.15; }
.projection-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.projection-summary-grid > div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f4; }
.projection-summary-grid span, .projection-summary-grid small { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.projection-summary-grid strong { margin: 7px 0 3px; display: block; font-family: Georgia, serif; font-size: 23px; }
.projection-summary-grid .projection-warning { border-color: #e1aaa5; color: var(--red); background: var(--red-soft); }
.projection-chart-wrap { margin-top: 20px; padding: 12px 12px 7px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.projection-chart { width: 100%; height: auto; min-height: 250px; display: block; }
.chart-grid-line { stroke: #e3e3de; stroke-width: 1; }
.chart-zero-line { stroke: var(--red); stroke-width: 1.8; stroke-dasharray: 7 6; opacity: .65; }
.chart-safe-line { stroke: #d2941f; stroke-width: 2; stroke-dasharray: 8 6; }
.chart-safe-label { fill: #8a610f; font-size: 11px; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 3px; }
.projection-axis-label { fill: var(--muted); font-size: 10px; font-weight: 750; }
.projection-line { fill: none; stroke: var(--navy-700); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.projection-income-marker { fill: var(--green); stroke: white; stroke-width: 2; }
.projection-low-marker { fill: var(--red); stroke: white; stroke-width: 2.5; }
.projection-low-label { fill: var(--red); font-size: 11px; font-weight: 850; paint-order: stroke; stroke: white; stroke-width: 4px; }
.projection-point { fill: transparent; cursor: pointer; }
.projection-point:hover, .projection-point:focus, .projection-point.is-selected { fill: rgba(29,72,96,.17); stroke: var(--navy-700); stroke-width: 2; outline: none; }
.projection-chart-axis { padding: 0 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 750; }
.projection-point-detail { margin: 12px 0 3px; padding: 10px 12px; display: grid; grid-template-columns: 1.2fr repeat(5, minmax(0, 1fr)); gap: 10px; align-items: center; border: 1px solid #d6ddd8; border-radius: 9px; background: #f5f8f5; color: var(--muted); font-size: 11px; }
.projection-point-detail > strong { color: var(--ink); font-size: 13px; }
.projection-point-detail span, .projection-point-detail b { display: block; }
.projection-point-detail b { margin-top: 3px; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.projection-assumption { margin: 10px 2px 0; color: var(--muted); font-size: 11px; }
.period-donut-layout { margin-top: 22px; }
.spending-review-filter-notice { margin: 0 0 12px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e5c680; border-radius: 9px; color: #704800; background: #fff8e7; font-size: 12px; }
.spending-review-filter-notice a { color: #704800; font-weight: 800; text-decoration: underline; white-space: nowrap; }
.review-center-panel h2 { margin: 6px 0 7px; font-family: Georgia, serif; font-size: 30px; }
.review-center-panel > .section-heading p, .review-queue-card > p { color: var(--muted); line-height: 1.55; }
.review-view-tabs { margin-top: 20px; padding: 4px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-deep); }
.review-view-tabs a { padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-radius: 7px; color: var(--navy-700); font-size: 12px; font-weight: 850; }
.review-view-tabs a.is-active { color: white; background: var(--navy-800); }
.review-view-tabs span { min-width: 20px; padding: 1px 6px; border-radius: 999px; color: var(--navy-700); background: white; text-align: center; font-size: 10px; }
.review-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-summary-card { padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-deep); }
.review-summary-card span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.review-summary-card strong { color: var(--navy-800); font-family: Georgia, serif; font-size: 30px; }
.review-queue-grid { margin-top: 18px; display: grid; gap: 16px; }
.review-queue-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.review-queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.review-queue-heading h3 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 23px; }
.review-queue-count { min-width: 32px; padding: 5px 9px; border-radius: 999px; color: white; background: var(--navy-800); text-align: center; font-weight: 850; }
.review-queue-list { margin-top: 13px; }
.review-queue-list .duplicate-review { margin-right: 0; margin-left: 0; }
.spending-decision-row { padding: 13px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; border-top: 1px solid #ebe9e1; }
.spending-decision-row:first-child { border-top: 0; }
.spending-decision-row small { margin-top: 4px; display: block; color: var(--muted); font-size: 11px; }
.spending-decision-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.spending-decision-actions form { margin: 0; }
.spending-decision-actions .primary-button, .spending-decision-actions .secondary-button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.decision-history-heading { margin-top: 22px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.decision-history-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 25px; }
.decision-history-heading p { max-width: 720px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.decision-history-heading > span { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.decision-history-list { margin-top: 14px; display: grid; gap: 12px; }
.decision-history-row { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.decision-history-meta, .decision-history-title, .decision-history-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.decision-history-meta { color: var(--muted); font-size: 10px; font-weight: 750; }
.decision-kind { color: var(--green); letter-spacing: .08em; text-transform: uppercase; }
.decision-history-title { margin-top: 9px; }
.decision-history-title small { margin-top: 3px; display: block; color: var(--muted); font-size: 11px; }
.decision-status { padding: 4px 8px; border-radius: 999px; color: #176244; background: var(--green-soft); font-size: 10px; font-weight: 850; white-space: nowrap; }
.decision-status.is-removed { color: #8d302b; background: var(--red-soft); }
.decision-history-compare { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.decision-history-compare > div { padding: 10px; border-radius: 8px; background: var(--paper-deep); }
.decision-history-compare span, .decision-history-compare small { display: block; color: var(--muted); font-size: 10px; }
.decision-history-compare strong { margin: 3px 0; display: block; font-size: 12px; }
.decision-change { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.decision-history-actions { margin-top: 13px; justify-content: flex-start; flex-wrap: wrap; }
.decision-history-actions form { margin: 0; }
.decision-history-actions .secondary-button, .decision-history-actions .danger-button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.decision-guidance { flex: 1 1 320px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.report-metrics { margin-top: 26px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-section { height: 440px; margin-top: 16px; display: flex; flex-direction: column; overflow: hidden; }
.report-section > .section-heading, .report-section > .report-filter, .report-section > .pagination { flex: 0 0 auto; }
.report-scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 8px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.summary-row { padding: 12px 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ebe9e1; }
.summary-row span, .summary-row small { display: block; }
.summary-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.report-filter { margin-bottom: 16px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.3fr auto; gap: 7px 10px; align-items: end; }
.report-filter label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.report-filter input, .report-filter select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.report-filter .report-inline-checkbox { min-height: 18px; grid-column: 4 / span 2; grid-row: 2; display: flex; align-items: center; gap: 6px; padding-left: 2px; cursor: pointer; white-space: nowrap; }
.report-filter .report-inline-checkbox input { width: 15px; height: 15px; margin: 0; padding: 0; border: 0; accent-color: var(--navy-800); }
.report-filter .report-activity-type-filter { grid-column: 1 / span 3; grid-row: 2; margin: 0; }
.report-filter-submit { grid-column: 5; grid-row: 1; }
.pagination { padding-top: 18px; display: flex; justify-content: center; gap: 20px; color: var(--muted); font-size: 12px; }
.pagination, .pagination-jump { align-items: center; }
.pagination-jump { display: inline-flex; gap: 7px; }
.pagination-jump input[type="number"] { width: 58px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; font: inherit; text-align: center; }
.pagination-jump button { padding: 6px 9px; border: 1px solid var(--navy-800); border-radius: 7px; color: white; background: var(--navy-800); cursor: pointer; font-size: 11px; font-weight: 800; }

@media (max-width: 1650px) {
  .bucket-grid { --bucket-column-count: 3; }
  .bucket-group-tiles { --bucket-column-count: 3; }
}

@media (max-width: 1100px) {
  .dashboard-shell { grid-template-columns: minmax(0, 1fr) 310px; }
  .date-context-banner { align-items: flex-start; flex-direction: column; }
  .date-context-controls { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .date-jump { width: 100%; max-width: 330px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bucket-grid { --bucket-column-count: 2; }
  .bucket-group-tiles { --bucket-column-count: 2; }
}

@media (max-width: 800px) {
  .topbar { padding: 0 18px; }
  .dashboard-shell { display: block; }
  .workspace { padding: 24px 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .date-jump { width: 100%; min-width: 0; }
  .ledger-panel { height: auto; max-height: 660px; position: static; border-left: 0; border-top: 4px solid var(--gold); }
  .action-grid, .detail-grid, .day-detail-grid { grid-template-columns: 1fr; }
  .data-management-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .user-management-row { grid-template-columns: minmax(130px, .8fr) minmax(190px, 1.2fr) auto; }
  .reset-callout { align-items: flex-start; flex-direction: column; }
  .deployment-callout { grid-template-columns: 1fr; }
  .installer-actions { width: 100%; }
  .detail-heading { align-items: flex-start; flex-direction: column; }
  .report-heading-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .report-heading-side { width: 100%; align-items: stretch; flex-direction: column; }
  .report-panel-heading { align-items: flex-start; flex-direction: column; }
  .chart-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-filter.has-safe-balance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-filter button { grid-column: 1 / -1; }
  .donut-chart-layout { grid-template-columns: 1fr; }
  .donut-chart { width: min(260px, 80vw); }
  .horizontal-bar-row { grid-template-columns: 1fr; gap: 5px; }
  .projection-summary-grid { grid-template-columns: 1fr; }
  .projection-point-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projection-point-detail > strong { grid-column: 1 / -1; }
  .detail-metrics { width: 100%; }
  .detail-balance { width: 100%; }
  .bucket-spend-summary, .bucket-activity-summary { width: 100%; min-width: 0; }
  .transaction-filter-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .detail-metrics { flex-direction: column; }
  .bucket-spend-summary-values { gap: 9px; }
  .bucket-spend-summary-values div + div { padding-left: 9px; }
  .bucket-spend-summary-values strong { font-size: 18px; }
  .bucket-activity-summary { padding: 8px 9px; }
  .bucket-activity-summary-title > small { font-size: 8px; }
  .bucket-activity-summary-row { gap: 4px; }
  .bucket-activity-summary-row > span { font-size: 9px; }
  .bucket-activity-summary-row > strong { font-size: 11px; }
  .bucket-activity-summary-header > span { font-size: 7px; }
}

@media (max-width: 560px) {
  .user-management-row { grid-template-columns: 1fr; }
  .user-email-field, .user-access-badge, .user-save-button { grid-column: 1; }
  .user-access-badge, .password-toggle-button, .user-save-button { justify-self: start; }
  .topbar { padding: 0 10px; }
  .brand { flex: 0 0 auto; gap: 6px; }
  .brand-icon { width: 36px; height: 36px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .top-actions { margin-left: auto; gap: 6px; }
  .top-actions > a { min-height: 38px; padding: 7px 8px; font-size: 11px; }
  .household-chip { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .date-context-banner { padding: 12px; }
  .date-context-copy { min-width: 0; }
  .date-context-title { align-items: flex-start; flex-direction: column; gap: 5px; }
  .date-context-title strong { font-size: 18px; }
  .date-context-controls { display: grid; grid-template-columns: 1fr; }
  .return-today-button, .date-jump, .view-switcher { width: 100%; max-width: none; }
  .return-today-button { justify-content: center; }
  .view-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view-switcher a { text-align: center; }
  .bucket-grid { --bucket-column-count: 1; }
  .bucket-group-tiles { --bucket-column-count: 1; }
  .field-row { grid-template-columns: 1fr; }
  .metric-card { min-height: 116px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .bucket-title-line, .bucket-actions, .bucket-filter { flex-wrap: wrap; }
  .bucket-control-bar { gap: 12px; }
  .workspace-control-bar { align-items: stretch; }
  .workspace-title-panel { align-self: flex-start; }
  .workspace-control-bar > .bucket-filter { flex: 0 1 auto; padding: 6px 0; }
  .bucket-title-line { align-items: flex-start; }
  .bucket-title-line h2 { width: auto; }
  .transaction-action-group { width: 100%; }
  .transaction-action-group .bucket-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .transaction-action-group .primary-button { min-width: 0; padding-right: 8px; padding-left: 8px; }
  .bucket-plan { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .report-metrics, .summary-grid, .report-filter, .review-summary-grid { grid-template-columns: 1fr; }
  .report-filter .report-inline-checkbox, .report-filter .report-activity-type-filter, .report-filter-submit { grid-column: 1; grid-row: auto; }
  .spending-decision-row { grid-template-columns: 1fr auto; }
  .spending-decision-actions { grid-column: 1 / -1; }
  .review-view-tabs { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-view-tabs a { justify-content: center; }
  .decision-history-heading { align-items: flex-start; flex-direction: column; }
  .decision-history-compare { grid-template-columns: 1fr; }
  .report-search-summary-row { align-items: stretch; flex-direction: column; gap: 14px; }
  .transaction-search-controls { flex-wrap: wrap; }
  .transaction-search-controls select { flex: 1 1 100%; }
  .transaction-filter-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .transaction-filter-scope > label:first-child, .transaction-filter-scope > label:last-child { grid-column: 1 / -1; }
  .transaction-filter-scope > label:nth-child(2) input, .transaction-filter-scope > label:nth-child(3) input { padding-right: 6px; padding-left: 7px; font-size: 12px; }
  .transaction-filter-scope.is-compact, .transaction-filter-options { grid-template-columns: 1fr; }
  .transaction-filter-scope.is-compact > label { grid-column: 1; }
  .transaction-filter-options .activity-type-filter { padding: 7px 8px; flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  .transaction-filter-options .activity-type-filter label { gap: 4px; font-size: 10px; }
  .transaction-filter-options .activity-type-filter input[type="checkbox"] { width: 15px; height: 15px; }
  .transaction-filter-actions { align-items: stretch; flex-direction: column; }
  .transaction-filter-actions.transaction-filter-actions-compact { display: flex; }
  .transaction-filter-actions-compact .primary-button, .transaction-filter-actions-compact .secondary-button { width: 100%; }
  .bucket-category-create-form, .bucket-category-rename-form { grid-template-columns: 1fr auto; }
  .bucket-category-admin-row { align-items: stretch; flex-direction: column; }
  .bucket-category-count { padding-bottom: 0; }
  .bucket-category-admin-row > form:last-child { margin: 0; }
  .report-spend-summary { padding-left: 0; }
  .chart-filter { grid-template-columns: 1fr; }
  .chart-filter.has-safe-balance { grid-template-columns: 1fr; }
  .chart-filter button { grid-column: auto; }
  .report-section { height: 520px; }
  .wide-field { grid-column: auto; }
}

/* Card accounts organize bank reports independently of budget buckets. */
.same-charge-shell { max-width: 1000px; }
.transaction-merge-dialog { width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-sizing: border-box; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--navy-700); overflow-y: auto; }
.transaction-merge-dialog::backdrop { background: rgba(12, 31, 43, .5); }
.merge-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.merge-panel-heading h2 { margin: 0; }
.merge-entry-headings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 18px 0; }
.merge-entry-headings > div { padding: 12px; background: var(--paper-deep); border-radius: 8px; overflow-wrap: anywhere; }
.merge-entry-headings span, .merge-entry-headings small { display: block; margin-top: 5px; }
.merge-entry-headings small, .merge-field-options small { color: var(--muted); font-size: 11px; }
.merge-field-row { min-width: 0; margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.merge-field-row legend { padding: 0 5px; font-weight: 750; }
.merge-field-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.merge-field-options label { min-width: 0; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; overflow-wrap: anywhere; }
.merge-field-options label:has(input:checked) { border-color: var(--green); background: #eef8f2; }
.merge-field-options label:last-child { justify-content: flex-end; text-align: right; }
.merge-field-options input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.merge-field-options span { min-width: 0; }
.merge-field-options small { display: block; margin-bottom: 4px; }
.merge-automatic { margin-top: 18px; padding: 12px; border-radius: 8px; background: var(--paper-deep); }
.merge-automatic summary { cursor: pointer; font-weight: 750; }
.merge-automatic dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.merge-automatic dt { font-weight: 700; }
.merge-automatic dd { margin: 0; overflow-wrap: anywhere; }
.merge-bank-corrections { margin: 16px 0; padding: 14px; background: #eef8f2; border: 1px solid var(--green); border-radius: 10px; }
.merge-bank-corrections p { margin: 6px 0 0; }
.merge-amount-confirmation { display: flex; align-items: flex-start; gap: 10px; }
.merge-amount-confirmation input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; }
.transaction-merge-dialog .merge-confirm-actions { position: sticky; bottom: -24px; padding: 12px 0; background: var(--surface); }
@media (max-width: 640px) { .transaction-merge-dialog { padding: 14px; width: calc(100vw - 16px); } .merge-field-options { gap: 6px; } .merge-field-options label { padding: 7px; gap: 6px; } .merge-automatic dl > div { grid-template-columns: 1fr; gap: 3px; } }
.same-charge-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; overflow-wrap: anywhere; }
.same-charge-entry small { grid-column: 1 / -1; line-height: 1.6; }
.same-charge-entry small.transaction-meta-expense { color: var(--red); }
.same-charge-entry small.transaction-meta-income { color: var(--green); }
.same-charge-candidate { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.same-charge-candidate .same-charge-entry { flex: 1; min-width: 0; }
.same-charge-candidate > a { flex-shrink: 0; }
.same-charge-confirm h2 { margin-top: 0; }
.same-charge-choice { display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.same-charge-choice:has(input:checked) { border-color: var(--green); background: #eef8f2; }
.same-charge-choice input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; }
.same-charge-choice > div { flex: 1; min-width: 0; }
.same-charge-choice .eyebrow { display: block; margin-bottom: 8px; }
.same-charge-confirm .form-actions { flex-wrap: wrap; }
@media (max-width: 640px) { .same-charge-candidate { flex-wrap: wrap; } .same-charge-candidate .same-charge-entry { flex-basis: 100%; } .same-charge-choice { padding: 12px; } }
.card-account-shell { max-width: 1240px; }
.card-account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; align-items: start; }
.card-account-group { margin-top: 22px; }
.card-account-group-heading { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line, #d9d7ce); }
.card-account-group-heading > .eyebrow { display: block; margin-bottom: 5px; }
.card-account-group-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.card-account-group-heading h2 { font-size: 24px; margin: 0; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.card-account-group-heading small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.card-account-group-heading button { flex: 0 0 auto; padding: 9px 12px; font-size: 12px; }
.card-group-extension-notice { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.card-group-extension-notice[hidden] { display: none; }
.card-import-results ul { list-style: none; padding: 0; margin: 0 0 12px; }
.card-import-results li { padding: 10px 0; border-bottom: 1px solid #ddd; overflow-wrap: anywhere; }
.card-import-results li strong, .card-import-results li small { display: block; }
.card-import-results li small { margin: 4px 0; }
.card-account-shell > .detail-heading, .bank-import-shell > .detail-heading { margin-bottom: 24px; }
.card-account-tile { border: 1px solid #c9d7e4; border-radius: 14px; background: linear-gradient(135deg, #fffefa, #e8f1fa); padding: 14px; box-shadow: 0 5px 18px #132f4110; min-width: 0; }
.card-account-tile-top { display: flex; justify-content: space-between; align-items: center; }
.card-account-chip { border: 1px solid #c0ced7; border-radius: 6px; color: #a78438; font-size: 19px; padding: 0 5px; }
.card-account-tile h3 { font-size: 21px; margin: 8px 0 4px; overflow-wrap: anywhere; }
.card-account-tile h3 a { color: inherit; text-decoration: none; font: inherit; }
.card-account-digits { font-size: 15px; letter-spacing: 2px; margin: 0 0 8px; }
.card-account-website { display: inline-block; margin-bottom: 8px; font-size: 12px; }
.card-account-note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid #7fa1b7; border-radius: 7px; background: #ffffff90; color: #27495d; font-size: 14px; line-height: 1.5; }
.card-account-tile .card-account-note { margin-bottom: 8px; padding: 7px 9px; font-size: 12px; line-height: 1.4; }
.card-account-status { margin: 6px 0 0; font-size: 12px; }
.card-account-status > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #19374c15; }
.card-account-status > div:last-child { border-bottom: 0; padding-bottom: 0; }
.card-account-status dt { color: #577084; }
.card-account-status dd { margin: 0; text-align: right; font-weight: 600; }
.card-account-actions, .card-account-tile .detail-actions { display: flex; align-items: center; gap: 12px; }
.card-account-archived { opacity: .7; }
.card-account-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.card-form-wide { grid-column: 1 / -1; }
.card-account-form input, .card-account-form select, .card-account-form textarea { max-width: 100%; }
.card-account-form textarea { resize: vertical; min-height: 88px; }
.card-account-form [hidden] { display: none !important; }
.provider-account-picker { padding: 16px; border: 1px solid var(--line, #d9d7ce); border-radius: 12px; background: #f5f8fa; min-width: 0; }
.provider-account-picker .form-actions { flex-wrap: wrap; align-items: center; }
.provider-account-picker select { width: 100%; min-width: 0; }
.card-review-start { margin: 16px 0; }
.card-review-start summary { cursor: pointer; font-weight: 700; }
.card-review-start-form { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.card-review-start-form .form-field { flex: 1 1 260px; min-width: 0; }
.card-review-start-form select { width: 100%; }
.card-account-form input[type="checkbox"] { width: 16px; height: 16px; align-self: start; }
.card-account-form .bank-import-presets { margin-top: 8px; flex-wrap: wrap; }
.card-coverage-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card-coverage-columns ul { padding-left: 20px; line-height: 1.8; }
.coverage-gap { color: #ad630c; }
.card-coverage-explainer { font-size: 13px; color: #577084; }
.card-detail-shell { padding-top: 24px; padding-bottom: 24px; }
.card-detail-shell > .back-link { margin-bottom: 14px; }
.card-detail-shell > .detail-heading { gap: 16px; margin-bottom: 14px; }
.card-detail-shell .detail-heading h1 { font-size: clamp(28px, 4vw, 38px); margin: 4px 0 6px; overflow-wrap: anywhere; }
.card-detail-shell .detail-heading > div { min-width: 0; }
.card-detail-shell .detail-actions { margin-top: 0; flex-wrap: wrap; gap: 6px; }
.card-detail-shell .detail-actions a { padding: 8px 10px; }
.card-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #577084; font-size: 13px; }
.card-detail-shell .card-account-note { padding: 9px 12px; margin-bottom: 12px; }
.card-detail-shell .detail-card { padding: 14px 16px; margin-top: 12px; }
.card-detail-shell .detail-card p { margin: 8px 0; }
.card-detail-shell .detail-card p:last-child { margin-bottom: 0; }
.card-coverage-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 14px; }
.card-coverage-title h2 { margin: 0; font-size: 21px; }
.card-coverage-title > span { font-size: 13px; font-weight: 700; }
.card-coverage-gaps, .card-coverage-ranges { margin-top: 10px; font-size: 13px; }
.card-detail-shell .detail-card ul { margin: 6px 0 0; padding-left: 19px; line-height: 1.5; }
.card-detail-disclosure > summary { cursor: pointer; font-weight: 750; font-size: 15px; }
.card-coverage-ranges > summary, .card-receipt-entry > summary { cursor: pointer; }
.card-detail-shell .card-report-row, .card-receipt-entry { padding: 10px 0; font-size: 13px; }
.card-receipt-entry { border-bottom: 1px solid #19374c15; }
.card-detail-disclosure .card-receipt-text { max-height: 320px; overflow: auto; }
.card-detail-disclosure > summary:focus-visible, .card-coverage-ranges > summary:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 4px; }
@media (max-width: 640px) {
  .card-detail-shell > .detail-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .card-detail-shell .detail-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .card-detail-shell .detail-actions a { min-width: 0; text-align: center; }
}
.card-report-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 20px; padding: 15px 0; border-bottom: 1px solid #19374c15; overflow-wrap: anywhere; }
.card-report-row small { grid-column: 1 / -1; }
.card-account-filter { margin: 0 0 18px; max-width: 350px; }
.card-receipt-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; }
.bank-fingerprint { margin-top: 5px; font-size: 11px; color: var(--muted); }
@media (max-width: 640px) {
  .card-account-form, .card-coverage-columns { grid-template-columns: 1fr; }
  .card-report-row { grid-template-columns: 1fr; }
  .card-account-shell .detail-heading { align-items: stretch; }
  .card-account-shell .detail-actions { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .topbar { padding-inline: 8px; }
  .brand { gap: 5px; }
  .brand-icon { width: 28px; height: 28px; }
  .brand strong { max-width: 52px; white-space: normal; font-size: 14px; line-height: 1.1; }
  .top-actions { gap: 4px; }
  .top-actions > a { padding-inline: 6px; font-size: 10px; }
  .account-menu-toggle { width: 34px; height: 34px; }
  .account-menu-toggle svg { width: 20px; height: 20px; }
}
@media (max-width: 380px) {
  .brand > span { display: block; }
  .brand strong { max-width: 46px; font-size: 12px; }
  .top-actions { gap: 3px; }
  .top-actions > a { padding-inline: 4px; }
}

.chase-report-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 24px; }
.chase-account-field { grid-column: 1 / -1; }
.chase-connect-card [data-chase-status] { padding: 12px 14px; border-radius: 8px; background: #edf4f8; overflow-wrap: anywhere; }
.chase-install-steps { padding-left: 24px; line-height: 1.7; }
.chase-install-steps li { padding-left: 4px; margin-bottom: 8px; }
.bank-csv-details { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #426580; }
.bank-csv-details .coverage-gap { flex-basis: 100%; }
@media (max-width: 520px) { .chase-report-form { grid-template-columns: minmax(0, 1fr); } }

.card-pending-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; margin: 0 0 22px; border: 1px solid #c4d5e1; border-radius: 12px; background: #e9f2f8; }
.card-get-transactions { display: inline-flex; }
.card-import-dialog { padding: 24px; }
.card-import-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-import-heading h2 { margin: 0; font-size: 25px; overflow-wrap: anywhere; }
.card-import-heading button { flex: 0 0 auto; padding: 6px 12px; font-size: 22px; }
.card-import-dialog [data-import-status] { background: #edf4f8; border-radius: 8px; padding: 14px; }
.card-import-dialog .form-actions { flex-wrap: wrap; }
.card-import-dialog [hidden] { display: none !important; }
.card-import-dialog [data-import-report-download] { margin: 18px 0; }
[data-import-download-status] { display: block; margin-top: 10px; }
.financial-provider-list { margin: 20px 0; }
.financial-provider-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.financial-provider-row label { display: flex; align-items: center; gap: 10px; }
.financial-provider-row input { width: 18px; height: 18px; }
.financial-provider-row label span { font-size: 12px; color: var(--muted); }
@media (max-width: 520px) { .card-pending-notice, .financial-provider-row { flex-direction: column; align-items: flex-start; } }


.dashboard-overview { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); align-items: start; gap: 14px; }
.dashboard-status-column { min-width: 0; display: grid; gap: 10px; }
.dashboard-overview .date-context-banner { margin: 0; }
.dashboard-overview .date-context-copy { min-width: 0; }
.dashboard-overview .date-context-title strong { font-size: 16px; }
.dashboard-overview .metric-grid { grid-template-columns: 1fr; }
.dashboard-overview .metric-card { min-height: 116px; }
.dashboard-overview .bucket-control-bar { display: grid; margin: 0; gap: 8px; }
.dashboard-overview .bucket-title-line { justify-content: space-between; gap: 8px; }
.dashboard-overview .workspace-title-panel { padding: 9px 12px; }
.dashboard-overview .workspace-title-panel h2 { min-width: 0; overflow-wrap: anywhere; }
.dashboard-overview .bucket-title-line a { flex-shrink: 0; }
.dashboard-bucket-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dashboard-bucket-filter label { min-width: 0; display: grid; gap: 4px; color: var(--navy-700); font-size: 11px; font-weight: 800; }
.dashboard-bucket-filter select { width: 100%; min-width: 0; min-height: 34px; padding: 6px 24px 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-800); background: var(--surface); font: inherit; }
.dashboard-spending-summary { min-width: 0; display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); align-items: start; gap: 8px; }
.dashboard-spending-summary .income-spending-daily-summary { grid-template-columns: 1fr; gap: 8px; margin: 0; }
.dashboard-spending-summary .income-spending-daily-summary > div { min-width: 0; min-height: 76px; padding: 12px; display: block; background: var(--surface); }
.dashboard-spending-summary .income-spending-trend { min-width: 0; }
.dashboard-home .bucket-workspace { margin-top: 12px; }
.dashboard-ledger-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.dashboard-ledger-heading h2 { grid-column: 1 / -1; }
.dashboard-ledger-heading .range-label { justify-self: start; }
.dashboard-ledger-heading .ledger-transaction-button { min-height: 38px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.06); white-space: nowrap; }
.dashboard-ledger-heading .ledger-transaction-button:hover { background: rgba(255,255,255,.15); }

@media (max-width: 1400px) {
  .dashboard-overview { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); }
  .dashboard-spending-summary { grid-template-columns: 1fr; }
  .dashboard-spending-summary .income-spending-daily-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-spending-summary .income-spending-daily-summary > div { padding: 9px; }
  .dashboard-spending-summary .income-spending-daily-summary dt { font-size: 11px; }
  .dashboard-spending-summary .income-spending-daily-summary dd { font-size: 18px; }
}
@media (max-width: 1100px) {
  .dashboard-overview { grid-template-columns: 1fr; }
  .dashboard-status-column { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .dashboard-overview .bucket-control-bar { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: end; }
  .dashboard-overview .date-context-banner { padding: 12px; }
  .dashboard-overview .metric-card { padding: 12px; }
  .dashboard-overview .metric-card.hero-metric strong { font-size: 28px; }
}
@media (max-width: 560px) {
  .dashboard-overview .bucket-control-bar { grid-template-columns: 1fr; }
  .dashboard-overview .date-context-title strong { font-size: 16px; }
  .dashboard-overview .metric-card { min-height: 108px; padding: 12px 10px; }
  .dashboard-overview .metric-card span { font-size: 10px; }
  .dashboard-overview .metric-card.hero-metric strong { font-size: 26px; }
  .dashboard-overview .metric-card small { font-size: 10px; }
  .dashboard-spending-summary .income-spending-daily-summary dd { font-size: 17px; }
}

/* Compact transaction report header and controls. */
.transaction-report-card { container-type: inline-size; }
.transaction-report-overview { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.8fr); align-items: start; gap: 22px; margin-bottom: 18px; }
.transaction-report-intro { min-width: 0; }
.transaction-report-intro .report-panel-heading { margin-bottom: 18px; }
.transaction-report-intro .report-panel-heading p { margin-bottom: 0; font-size: 13px; }
.transaction-report-overview .transaction-history-filter { min-width: 0; margin: 0; padding: 10px; gap: 8px; }
.transaction-report-overview .transaction-filter-scope { grid-template-columns: 1.15fr 1fr 1fr 1.1fr; gap: 7px; }
.transaction-report-overview .transaction-filter-scope label, .transaction-report-overview .transaction-filter-search { min-width: 0; gap: 4px; font-size: 10px; }
.transaction-report-overview .transaction-filter-scope input, .transaction-report-overview .transaction-filter-scope select, .transaction-report-overview .transaction-filter-search input { padding: 8px; font-size: 12px; min-height: 36px; }
.transaction-report-overview .transaction-filter-options { gap: 7px; }
.transaction-report-overview .activity-type-filter { padding: 6px 7px; gap: 8px; }
.transaction-report-overview .activity-type-filter label { gap: 4px; font-size: 10px; }
.transaction-report-overview .transaction-history-checkbox { padding: 6px 7px; min-height: 35px; font-size: 10px; white-space: normal; }
.transaction-report-overview .transaction-filter-actions-compact { display: flex; flex-direction: row; justify-content: space-between; gap: 8px; }
.transaction-report-overview .transaction-filter-submit { display: flex; justify-content: flex-end; gap: 7px; }
.transaction-report-overview .transaction-filter-actions-compact .primary-button, .transaction-report-overview .transaction-filter-actions-compact .secondary-button { width: auto; min-width: 65px; padding: 8px 12px; }
.bucket-report-balance-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.bucket-report-balance { min-width: 130px; }
.bucket-report-balance > span, .bucket-report-balance > strong, .bucket-report-balance > small { display: block; }
.bucket-report-balance > span { color: var(--ink); font-size: 12px; font-weight: 800; }
.bucket-report-balance > strong { margin-top: 3px; font: bold 28px Georgia, serif; }
.bucket-report-balance > small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.bucket-report-balance-row > button { padding: 9px 12px; }
@container (max-width: 850px) {
  .transaction-report-overview { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 560px) {
  .transaction-report-overview { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .transaction-report-overview .transaction-filter-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transaction-report-overview .transaction-filter-options { grid-template-columns: minmax(0, 1fr); }
  .transaction-report-overview .transaction-filter-actions-compact .primary-button, .transaction-report-overview .transaction-filter-actions-compact .secondary-button { min-width: 0; padding: 8px 10px; }
  .transaction-report-card .report-search-summary-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

/* Avoid stacking general report margins above focused bucket history. */
.transaction-history-shell { padding-top: 18px; }
.transaction-history-shell > .back-link { margin-bottom: 8px; }
.transaction-history-shell > .reports-layout-standalone { margin-top: 0; }
.transaction-history-shell .all-transactions-card { margin-top: 0; }

/* Dashboard reporting timeframe pills. */
.dashboard-trend-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.dashboard-trend-pill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--navy-700); background: var(--surface); font-size: 12px; font-weight: 700; text-decoration: none; }
.dashboard-trend-pill:hover, .dashboard-trend-pill:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.dashboard-trend-pill.is-active { color: white; background: var(--navy-700); border-color: var(--navy-700); }
