/* Shared by Banking, Spent and Received. No page-specific geometry. */
.transaction-toolbar.xb-shared-filters {
  display: grid;
  grid-template-columns: minmax(150px,1.6fr) minmax(116px,.85fr) repeat(2,minmax(126px,.85fr)) minmax(140px,1.2fr) minmax(112px,.85fr) auto;
  gap: 10px;
  align-items: end;
}
.xb-shared-filters > .filter-field { min-width: 0; width: auto; }
.xb-shared-filters .xb-filter-button { height: 38px; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.xb-shared-filters .xb-filter-button svg { width: 14px; height: 14px; }
.xb-shared-filters .tag-filter-options label {
  display: flex; grid-template-columns: none; gap: 8px; min-height: 28px; height: auto;
  padding: 3px 4px; margin: 0; align-items: center; font-weight: 500;
}
.xb-shared-filters .tag-filter-options input[type=checkbox],
:is(.xb-bank-column-filter,.xb-filter-picker-menu) .xb-filter-choice-row input[type=checkbox] { width: 16px; height: 16px; min-width: 16px; min-height: 16px; margin: 0; padding: 0; flex: 0 0 16px; }
.xb-shared-filters .tag-filter-options label > span { margin: 0; line-height: 20px; }
.xb-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
:is(.xb-filter-chips,.xb-bank-summary-overflow) { --xb-filter-remove-hover-content: #000; }
.xb-filter-chips:not(:empty) { padding: 10px 16px; border-top: 1px solid var(--xb-color-outline-variant); }
.xb-filter-chips button { min-height: 28px; padding: 3px 9px; font-size: var(--font-size-body); font-weight: var(--font-weight-body); background: var(--xb-field-container); color: var(--xb-field-content); border: 1px solid var(--xb-field-border); border-radius: var(--xb-shape-full); }
.xb-filter-chip-remove { margin-inline-start: 6px; color: var(--xb-color-on-surface-variant); }
.xb-filter-chip-remove:hover { color: var(--xb-filter-remove-hover-content); }

.xb-transaction-filter-dialog header { display: flex; justify-content: space-between; align-items: start; padding: 22px 24px 18px; border-bottom: 1px solid var(--xb-color-outline-variant); }
.xb-transaction-filter-dialog h2 { font-size: 19px; font-weight: 600; margin: 0; }
.xb-transaction-filter-dialog p { color: var(--xb-color-on-surface-variant); font-size: 12px; margin: 5px 0 0; }
.xb-filter-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px 16px; padding: 22px 24px; }
.xb-filter-fields label:not(.xb-filter-choice-row) { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 12px; font-weight: 500; }
.xb-filter-fields label:first-child { grid-column: 1; }
.xb-filter-fields input,.xb-filter-fields select { width: 100%; min-width: 0; min-height: 40px; background: var(--xb-field-container); color: var(--xb-field-content); border: 1px solid var(--xb-field-border); font-size: 14px; font-weight: 400; }
.xb-filter-amounts { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.xb-filter-amounts input { text-align: right; font-variant-numeric: tabular-nums; }
.xb-filter-amounts p { grid-column: 1/-1; margin: 0; }
.xb-transaction-filter-dialog footer { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--xb-color-outline-variant); }
.xb-filter-reset { margin-right: auto; background: transparent; border: 0; color: var(--xb-color-on-surface-variant); }
@media(max-width:1100px) { .transaction-toolbar.xb-shared-filters { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:600px) { .transaction-toolbar.xb-shared-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } .xb-filter-fields { padding: 18px; } }
/* Navigation weight follows selection, not whether a submenu is expanded. */
.nav .nav-toggle, .me-menu-button, .me-menu-button > span:last-child { font-weight: var(--font-weight-nav); }
.nav .nav-group:has(a[aria-current=page]) > .nav-toggle,
.nav .nav-section:has(a[aria-current=page]) > .nav-toggle,
.nav .nav-toggle[aria-current=page],
.me-menu-button[aria-expanded=true], .me-menu-button[aria-expanded=true] > span:last-child { font-weight: var(--font-weight-nav-active); }

.xb-shared-filters .tag-filter-picker > summary { min-height: 38px; height: 38px; }
.xb-shared-filters > [hidden] { display: none !important; }

.xb-filter-chips[hidden], .xb-filter-amounts[hidden], .xb-filter-amounts [hidden] { display: none !important; }
@media (min-width: 768px) {
  #bankTransactionsView .bank-transaction-control-surface { padding-bottom: 0; border-bottom: 0; }
  .xb-desktop-category-host { display: block; min-width: 0; }
  select.xb-category-adapted, .xb-desktop-select:has(+ select.xb-category-adapted) { display: none !important; }
  .xb-desktop-category-host .category-combobox-input { height: 38px; min-height: 38px; width: 100%; }
}
@media (max-width: 767px) { .xb-desktop-category-host { display: none !important; } }

/* Editable filter fields share a clear surface regardless of their value. */
.xb-shared-filters .filter-field:has(select[id$="datePreset"],select[id$="DatePreset"]) .xb-desktop-select-trigger:not(:disabled),
.xb-shared-filters select[id$="datePreset"]:not(:disabled),
.xb-shared-filters select[id$="DatePreset"]:not(:disabled),
.xb-shared-filters .tag-filter-picker > summary:not([aria-disabled="true"]),
.transfer-history-toolbar .transfer-filter-field:has([data-transfer-filter="datePreset"]) .xb-desktop-select-trigger:not(:disabled),
.transfer-history-toolbar [data-transfer-filter="datePreset"]:not(:disabled) {
  background: var(--xb-color-surface-container-lowest);
}

.xb-shared-filters .xb-desktop-select-trigger,
.xb-shared-filters .tag-filter-picker > summary,
.xb-shared-filters .tag-filter-summary-text,
.xb-shared-filters .xb-desktop-select-trigger > span { font-weight:var(--font-weight-body); }

.xb-shared-filters .category-combobox-input,
.xb-shared-filters .category-combobox-input::placeholder { font-size:13px; font-weight:var(--font-weight-body); color:var(--xb-field-content); opacity:1; }
.xb-shared-filters .category-combobox-option-name,
.xb-shared-filters .category-combobox-option-number { font-weight:var(--font-weight-body); }

.xb-transaction-filter-dialog .xb-filter-fields :is(input,select,.xb-desktop-select-trigger):not(:disabled),
.xb-transaction-filter-dialog .tag-filter-picker > summary { background:var(--xb-color-surface-container-lowest); }
.xb-transaction-filter-dialog footer :is(.primary,.secondary) { height:40px; min-height:40px; box-sizing:border-box; padding:0 14px; border-radius:var(--xb-shape-button-compact); }

/* Shared anchored settings surface; fields retain the shared editable tokens. */
.xb-transaction-filter-dialog.xb-settings-popover header { padding:0 0 12px; }
.xb-transaction-filter-dialog.xb-settings-popover h2 { font-size:14px; }
.xb-transaction-filter-dialog.xb-settings-popover:not(.xb-bank-column-filter) .xb-filter-fields { padding:4px 0; gap:12px; }
.xb-transaction-filter-dialog.xb-settings-popover footer { padding:12px 0 0; }
.xb-transaction-filter-dialog.xb-settings-popover footer :is(.primary,.secondary) { height:36px; min-height:36px; }

/* Banking keeps applied column filters in the toolbar rather than a second row. */
.transaction-toolbar.xb-shared-filters.xb-bank-inline-filters {
  grid-template-columns: minmax(150px,1.4fr) minmax(108px,.7fr) repeat(2,minmax(120px,.75fr)) minmax(112px,.75fr) minmax(150px,1fr);
}
.xb-bank-inline-summary:not(:empty) { display:flex; flex-wrap:nowrap; align-items:center; gap:6px; min-width:0; height:38px; padding:0; border:0; }
.xb-bank-summary-item { display:flex; align-items:center; min-width:0; background:var(--xb-field-container); color:var(--xb-field-content); border:1px solid var(--xb-field-border); border-radius:var(--xb-shape-full); }
.xb-bank-inline-summary > .xb-bank-summary-item { flex:0 1 auto; max-width:100%; }
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-item button { background:transparent; color:inherit; border:0; font-family:var(--font-sans); font-size:var(--font-size-body); font-weight:var(--font-weight-body); min-height:28px; }
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-edit { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; padding:3px 6px; }
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove { flex:0 0 auto; padding:3px 6px; }
.xb-bank-inline-summary :is(.xb-bank-summary-more,.xb-bank-summary-clear) { flex:0 0 auto; white-space:nowrap; }
.xb-filter-chips .xb-bank-summary-clear { background:transparent; color:var(--xb-field-content); padding:3px; border:0; border-radius:0; font-family:var(--font-sans); font-size:var(--font-size-body); font-weight:var(--font-weight-body); }
.xb-filter-chips .xb-bank-summary-clear:is(:hover,:focus-visible) { color:var(--xb-color-primary); }
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove { color:var(--xb-color-on-surface-variant); }
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove:is(:hover,:focus-visible) { color:var(--xb-filter-remove-hover-content); }
.xb-bank-summary-overflow { z-index:calc(var(--z-sidebar-rail) + 10); }
.xb-bank-summary-overflow .xb-bank-summary-item + .xb-bank-summary-item { margin-top:6px; }

/* Transfers consumes the same desktop toolbar and field roles. */
.transfer-history-toolbar.xb-bank-inline-filters > [hidden] { display:none !important; }
.transfer-history-toolbar.xb-bank-inline-filters .transfer-filter-field { min-width:0; }
.transfer-history-toolbar.xb-bank-inline-filters input,.transfer-history-toolbar.xb-bank-inline-filters select { width:100%;min-width:0; }
.xb-operational-table.xb-bank-resizable .xb-bank-column-header { position:relative; }
.xb-operational-table .xb-bank-column-header .sort-arrow[hidden] { display:none; }

:root[data-theme="dark"] :is(.xb-filter-chips,.xb-bank-summary-overflow) { --xb-filter-remove-hover-content: var(--xb-field-content); }

/* Desktop applied conditions: neutral field surface, compact bottom alignment.
   Explicit type overrides preserve field typography against the global button rule. */
:is(.xb-filter-chips,.xb-bank-summary-overflow) {
  --xb-filter-chip-content: var(--xb-field-label);
  --xb-filter-chip-outline: var(--xb-color-outline-variant);
  --xb-filter-remove-hover-content: var(--xb-color-primary);
}
.xb-bank-inline-summary:not(:empty) { align-items:flex-end; }
.xb-bank-summary-item {
  box-sizing:border-box;
  height:27px;
  background:var(--xb-color-surface-container-lowest);
  color:var(--xb-filter-chip-content);
  border:0.75px solid var(--xb-filter-chip-outline);
}
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-item button,
.xb-filter-chips .xb-bank-summary-clear {
  font-size:11px !important;
  font-weight:400 !important;
  line-height:var(--line-height-body) !important;
  color:var(--xb-filter-chip-content);
  min-height:0;
  height:25px;
  padding-block:0;
}
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove {
  font-size:calc(var(--font-size-body) * 1.82) !important;
  padding-inline:4px 9px;
}
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove:is(:hover,:focus-visible),
.xb-filter-chips .xb-bank-summary-clear:is(:hover,:focus-visible) {
  color:var(--xb-color-primary);
  font-weight:600 !important;
  background:transparent;
}

/* Reserve clear-action space before hover; scale the glyph without reflow. */
.xb-bank-inline-summary .xb-bank-summary-clear {
  box-sizing:border-box;
  width:64px;
  flex:0 0 64px;
  text-align:center;
}
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove {
  width:30px;
  box-sizing:border-box;
  transform-origin:center;
}
:is(.xb-bank-inline-summary,.xb-bank-summary-overflow) .xb-bank-summary-remove:is(:hover,:focus-visible) {
  transform:scale(1.2);
}