@media (min-width: 901px) {
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-column-header { position: relative; cursor: pointer; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-column-header > .sort-button { width: calc(100% - 22px); min-height: 28px; padding-right: 0; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-column-header .sort-button .sort-arrow { position: static; flex: 0 0 14px; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .bank-amount-sort-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .xb-bank-column-options { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 20px; height: 26px; min-height: 0; padding: 0; line-height: 1; border: 0; background: transparent; color: var(--xb-color-outline-variant); opacity: 0; }
  .xb-bank-column-options svg { width: 16px; height: 16px; }
  .xb-bank-column-header:is(:hover,:focus-within) .xb-bank-column-options, .xb-bank-column-options[aria-expanded="true"] { opacity: 1; }
  .xb-bank-resize { position: absolute; right: -4px; top: 0; bottom: 0; width: 8px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; z-index: 2; }
  .xb-bank-resize::after { content: ''; position: absolute; left: 3px; top: 28%; bottom: 28%; width: 1px; border-radius: 1px; background: var(--xb-color-outline-variant); }
  .xb-bank-resize:is(:hover,:focus-visible,.is-dragging)::after { background: var(--xb-tab-selected-container); left: 2px; width: 3px; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-resizable th:last-child { position: relative; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-resizable th:last-child::before { content: ''; position: absolute; left: 0; top: 28%; bottom: 28%; width: 1px; background: var(--xb-color-outline-variant); pointer-events: none; }
  .is-resizing { user-select: none; }
  .xb-columns-resize-disabled .xb-bank-resize { display: none !important; }
}
.xb-bank-column-menu.xb-settings-popover, .xb-transaction-filter-dialog.xb-settings-popover { z-index: calc(var(--z-sidebar-rail) + 10); }
.xb-bank-column-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-radius: var(--xb-shape-button-compact); background: transparent; color: var(--xb-color-on-surface); padding: 8px 10px; font-family: var(--font-sans); font-size: var(--font-size-body); font-weight: 500; line-height: var(--line-height-body); }
.xb-bank-column-menu button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.xb-bank-column-menu button:hover { background: var(--xb-color-surface-container); }
.xb-bank-column-menu hr { border: 0; border-top: 1px solid var(--xb-field-border); margin: 6px 0; }
.xb-bank-filter-options { max-height: 180px; overflow: auto; border: 1px solid var(--xb-field-border); border-radius: var(--xb-shape-button-compact); padding: 8px; }
.xb-filter-fields .xb-bank-filter-options label { display: flex; flex-direction: row; gap: 8px; align-items: center; padding: 4px; }
.xb-filter-fields fieldset:has(.xb-bank-filter-options) { grid-column: 1 / -1; min-width: 0; }
.xb-filter-fields .xb-bank-filter-options input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; margin: 0; flex: 0 0 16px; }
@media print { .xb-bank-column-options, .xb-bank-resize { display: none !important; } }

.xb-bank-column-menu button span { color: inherit; font-family: inherit; font-size: inherit; font-weight: 500; line-height: inherit; }
@media (min-width: 901px) {
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-money-header > .sort-button { width: 100%; padding-left: 12px; padding-right: 0; justify-content: flex-end; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-money-header .xb-bank-column-options { left: 3px; right: auto; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-money-header .sort-arrow { order: -1; }
  :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-money-header .xb-bank-filter-indicator { left: 3px; right: auto; }
  .xb-bank-column-header .sort-arrow { visibility: hidden; }
  .xb-bank-column-header .sort-arrow.is-active { visibility: visible; }
}
.xb-bank-filter-indicator { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 20px; pointer-events: none; color: var(--xb-color-on-primary-container); }
.xb-bank-filter-indicator[hidden], .xb-bank-column-header:is(:hover,:focus-within) .xb-bank-filter-indicator { visibility: hidden; }
.xb-bank-filter-indicator svg { width: 12px; height: 12px; stroke-width: 2.5; }
.xb-bank-column-filter .xb-filter-fields { display: block; padding: 12px 0; }
.xb-bank-column-filter .xb-bank-column-filter-section { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin-bottom: 16px; }
.xb-bank-column-filter .xb-filter-fields > label { margin-bottom: 12px; }
.xb-bank-column-filter [hidden] { display: none !important; }
.xb-bank-column-filter header, .xb-bank-column-filter footer { padding: 8px 0; }
.xb-bank-column-filter fieldset { border: 0; padding: 0; min-width: 0; }
.xb-bank-column-filter legend { margin-bottom: 8px; font-size: var(--font-size-body); }

@media (min-width: 901px) { :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .xb-bank-money-header, :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .banking-table td:nth-child(3), :is(#bankTransactionsTablePanel,#expensesView,#incomeView,#transfersView) .banking-table td:nth-child(4) { padding-right: 12px; } }

/* Compact filter surfaces keep actions separate from their scrollable fields.
   Keep an inset on every side for external focus rings; generic dialog field
   padding explicitly excludes this bank-specific scroll container. */
.xb-bank-column-filter.xb-settings-popover { display: flex; flex-direction: column; padding: 14px; overflow: visible; }
.xb-bank-column-filter.xb-settings-popover form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 0; margin: 0; }
.xb-bank-column-filter.xb-settings-popover header { flex: 0 0 auto; margin: 0; padding: 0 0 10px; align-items: center; }
.xb-bank-column-filter.xb-settings-popover h2 { font-size: 16px; line-height: 22px; margin: 0; }
.xb-bank-column-filter.xb-settings-popover .dialog-close-icon { width: 28px; height: 28px; min-height: 28px; padding: 0; display: grid; place-items: center; }
.xb-bank-column-filter .dialog-close-icon svg { width: 16px; height: 16px; }
.xb-bank-column-filter.xb-settings-popover .xb-filter-fields { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--xb-space-6) var(--xb-space-3); }
.xb-bank-column-filter .xb-bank-column-filter-section { gap: 10px; margin-bottom: 12px; }
.xb-bank-column-filter .xb-bank-column-filter-section:last-child { margin-bottom: 0; }
.xb-bank-column-filter.xb-settings-popover footer { flex: 0 0 auto; margin: 0; padding: 10px 0 0; gap: 8px; }
.xb-bank-column-filter.xb-settings-popover footer button { min-height: 32px; height: 32px; padding: 4px 10px; }
.xb-bank-column-filter .xb-filter-multi-picker > label { margin-bottom: 7px; }
.xb-bank-column-filter .xb-filter-multi-picker .category-combobox,
.xb-bank-column-filter .bank-review-select-combobox-trigger { width: 100%; min-width: 0; }
:is(.xb-bank-column-filter,.xb-filter-picker-menu) .xb-filter-choice-row { align-items: center; gap: 8px; font-weight: 500; }
:is(.xb-bank-column-filter,.xb-filter-picker-menu) label.category-combobox-option { display: grid; grid-template-columns: 16px minmax(44px,auto) minmax(0,1fr); flex-direction: row; }
:is(.xb-bank-column-filter,.xb-filter-picker-menu) label.bank-review-select-combobox-option { display: flex; flex-direction: row; }
:is(.xb-bank-column-filter,.xb-filter-picker-menu) .xb-filter-choice-row.is-selected { background: color-mix(in srgb, var(--xb-color-primary) 12%, transparent); color: var(--xb-color-primary); }
:is(.xb-bank-column-filter,.xb-filter-picker-menu) .xb-filter-choice-row > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xb-filter-picker-menu { z-index: calc(var(--z-sidebar-rail) + 20); }
.xb-bank-column-filter.xb-settings-popover header, .xb-bank-column-filter.xb-settings-popover footer { border: 0; }

/* Filter choices use the same normal body typography as Tags. */
body .xb-filter-picker-menu .xb-filter-choice-row,
body .xb-filter-picker-menu .xb-filter-choice-row :is(span,.category-combobox-option-number,.category-combobox-option-name,.category-combobox-option-name-text) {
  font-family: var(--font-sans); font-size: var(--font-size-body); font-weight: var(--font-weight-body) !important; line-height: var(--line-height-body); color: inherit;
}
body .xb-filter-picker-menu label.category-combobox-option { grid-template-columns: 16px max-content minmax(0,1fr); column-gap: 8px; }
body .xb-filter-picker-menu .category-combobox-option-number { margin-right: calc(2ch - 8px); }

/* Portalled filter pickers have one scroll owner: the inner options list. */
.xb-filter-picker-menu.desktop-category-combobox-menu { overflow: hidden; padding: 0; }

/* Reports share header controls, without operational column filters. */
.xb-report-columns .xb-report-column-hidden { display: none !important; }
.xb-report-column-header { position: relative; cursor: pointer; }
.xb-report-column-header .xb-report-label { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; min-height: 28px; padding: 0 22px 0 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.xb-report-column-header .xb-report-label > span:first-child { min-width: 0; }
.xb-report-column-header .xb-report-label svg { width: 14px; height: 14px; flex: 0 0 14px; }
.xb-report-column-header .xb-report-label:not(.is-active) .xb-sort-indicator:not(.is-active) { display: none; }
.xb-report-number-header .xb-report-label { justify-content: flex-end; padding: 0 0 0 22px; text-align: right; flex-direction: row; }
.xb-report-column-header:is(:hover,:focus-within) .xb-bank-column-options { opacity: 1; }
.xb-report-number-header .xb-bank-column-options { left: 3px; right: auto; }
.xb-report-columns td.report-amount { white-space: nowrap; }
.xb-report-columns td:not(.report-amount) { overflow: hidden; text-overflow: ellipsis; }
.xb-report-resize-option { display: flex; gap: 8px; align-items: center; }
@media print { .xb-report-columns .xb-bank-column-options,.xb-report-resizer { display: none !important; } }

.xb-report-columns .xb-report-label > .xb-sort-indicator { position: static; flex: 0 0 14px; }
.xb-report-columns .xb-report-number-header .xb-report-label > :is(.xb-sort-indicator,.xb-report-sort-arrow) { order: -1; }
.xb-report-columns .xb-report-label > .xb-sort-indicator:not(.is-active) { display: none; }

/* Single-action column menus share behavior but use compact menu density. */
.xb-bank-column-menu.xb-settings-popover:has(> button:only-child) {
  padding: var(--xb-space-2);
  border-radius: var(--xb-shape-sm);
  box-shadow: var(--xb-elevation-1);
}
.xb-bank-column-menu.xb-settings-popover > button:only-child {
  min-height: 36px;
  gap: var(--xb-space-4);
  padding: var(--xb-space-3) var(--xb-space-4);
}
