.bank-pending-summary{display:flex;justify-content:space-between;align-items:center;gap:var(--ui-space-3);padding:var(--ui-space-3);margin-bottom:var(--ui-space-4);color:var(--text-primary);text-decoration:none}
.bank-pending-summary>span,.bank-pending>summary>span{display:flex;align-items:center;gap:var(--ui-space-2);min-width:0}
.bank-pending-summary>strong,.bank-pending>summary>strong{flex-shrink:0;font-variant-numeric:tabular-nums}
.bank-pending-summary:focus-visible,.bank-pending>summary:focus-visible{outline:2px solid var(--ui-primary);outline-offset:3px}
.bank-pending{padding:0;margin-block:var(--ui-space-4);overflow:hidden}
.bank-pending>summary{display:flex;align-items:center;justify-content:space-between;gap:var(--ui-space-3);padding:var(--ui-space-3) var(--ui-space-4);cursor:pointer;min-height:var(--ui-control-height)}
.bank-pending>summary::after{content:'⌄';color:var(--text-secondary)}
.bank-pending>summary>strong{margin-left:auto}
.bank-pending[open]>summary{border-bottom:1px solid var(--border)}
.bank-pending-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-3);padding:var(--ui-space-3) var(--ui-space-4)}
.bank-pending-row+.bank-pending-row{border-top:1px solid var(--border)}
.bank-pending-row>div{flex:1 1 200px;min-width:0;overflow-wrap:anywhere}
.bank-pending-row>strong{margin-left:auto;flex-shrink:0;font-variant-numeric:tabular-nums;white-space:nowrap}
.bank-pending-context{display:block;color:var(--text-secondary);font-size:12px;margin-top:4px}
.bank-pending-row p{font-size:13px;color:var(--text-secondary);margin:4px 0 0;overflow-wrap:anywhere}
.bank-pending>footer{padding:var(--ui-space-2) var(--ui-space-4);border-top:1px solid var(--border);font-size:12px;color:var(--text-secondary);text-align:right}
.bank-account-metadata{margin-block:var(--ui-space-3)}
.bank-account-metadata>summary{cursor:pointer;font-weight:600;min-height:var(--ui-control-height);align-content:center}
.bank-account-metadata dl{margin:0}
.bank-account-metadata dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:var(--ui-space-2);padding:var(--ui-space-1) 0;border-top:1px solid var(--border)}
.bank-account-metadata dt{color:var(--text-secondary);font-size:13px}
.bank-account-metadata dd{margin:0;text-align:right;overflow-wrap:anywhere}
@media(max-width:700px){.bank-pending>summary,.bank-pending-row{padding:var(--ui-space-3)}.bank-pending>footer{padding:var(--ui-space-2) var(--ui-space-3)}.bank-pending-summary{flex-wrap:wrap}.bank-pending-summary>strong{margin-left:auto}}
/* Wrap complete names and amounts as units on narrow screens. */
.bank-pending>summary{flex-wrap:wrap;gap:var(--ui-space-1) var(--ui-space-2)}
.bank-pending>summary>span{flex:1 1 180px}
.bank-pending>summary>span>strong{overflow-wrap:normal}
.transaction-tabs-shell .transaction-detail-row.bank-detail-row{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:var(--ui-space-3)}
.transaction-tabs-shell .bank-detail-row>strong{max-width:none;word-break:normal;overflow-wrap:anywhere}

.bank-pending-accounts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:var(--ui-space-4);padding:var(--ui-space-4);margin-block:var(--ui-space-4)}
.bank-pending-accounts .bank-account-metadata{margin:0;min-width:0}
.bank-pending-accounts header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:var(--ui-space-2);margin-bottom:var(--ui-space-2)}
.bank-pending-accounts header>strong{overflow-wrap:anywhere}
.bank-pending-accounts header>span{font-size:13px;color:var(--text-secondary)}
.bank-liquidity{margin-block:var(--ui-space-3)}
.bank-liquidity>div{display:flex;flex-wrap:wrap;justify-content:space-between;gap:var(--ui-space-2);padding-block:var(--ui-space-1)}
.bank-liquidity dt{color:var(--text-secondary);font-size:13px}
.bank-liquidity dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto}
.bank-pending-summary{flex-wrap:wrap}
.bank-pending-summary>span{flex-wrap:wrap}
.bank-pending-summary>strong{margin-left:auto}

.bank-pending-summary>strong,.bank-pending>summary>strong{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ui-space-1) var(--ui-space-2);min-width:0;max-width:100%;flex-shrink:1}
.bank-pending-summary>strong>span,.bank-pending>summary>strong>span{white-space:nowrap}
.bank-account-metadata .bank-liquidity>div{display:flex;grid-template-columns:none}
.bank-account-metadata .bank-liquidity dd{max-width:100%;overflow-wrap:anywhere}

.bank-pending-row>.bank-pending-plan{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--ui-space-1) var(--ui-space-3);padding:var(--ui-space-2) var(--ui-space-3);border-left:3px solid var(--border);background:var(--bg-card-hover);font-size:13px}
.bank-pending-plan>a{font-weight:600;color:var(--text-primary);overflow-wrap:anywhere}
.bank-pending-plan>span{color:var(--text-secondary)}
.bank-pending-plan>span:has(strong){margin-left:auto}
.bank-pending-plan strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.bank-pending-row>.bank-pending-plan-changed{border-left-color:var(--expense)}
.bank-pending-plan-difference{color:var(--text-primary)}

.bank-pending-category{min-width:0}
.bank-pending-category>summary{cursor:pointer;color:var(--text-secondary);font-size:13px;min-height:var(--ui-control-height);align-content:center}
.bank-pending-category form{padding-block:var(--ui-space-2)}
.bank-pending-category-controls{display:flex;flex-wrap:wrap;gap:var(--ui-space-2);align-items:center}
.bank-pending-category-controls select{flex:1 1 200px;min-width:0;max-width:100%}
.bank-pending-category-controls button{margin-left:auto}

.bank-pending-error{margin:var(--ui-space-3) var(--ui-space-4);color:var(--expense)}

/* Category actions stay with the merchant; the picker uses the top layer. */
.bank-pending-category{margin-top:var(--ui-space-1)}
.bank-pending-category>.pending-category-chip{display:inline-flex;align-items:center;gap:var(--ui-space-1);max-width:100%;min-height:var(--ui-control-height);padding:var(--ui-space-1) var(--ui-space-2);border:1px solid var(--border);background:var(--bg-card-hover);color:var(--text-primary);font-size:13px;font-weight:600;line-height:1.4;list-style:none}
.pending-category-chip::-webkit-details-marker{display:none}
.pending-category-chip>span:first-child{min-width:0;overflow-wrap:anywhere}
.pending-category-chip>span:last-child{flex-shrink:0;color:var(--text-secondary)}
.pending-category-chip:focus-visible{outline:2px solid var(--ui-primary);outline-offset:2px}
.pending-category-feedback{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);margin-top:var(--ui-space-1);font-size:13px;color:var(--text-secondary)}
.pending-category-feedback[hidden]{display:none}
.pending-category-open{overflow:hidden}
.pending-category-picker{position:fixed;inset:auto;margin:0;width:360px;max-width:calc(100vw - var(--ui-space-4));max-height:calc(100dvh - var(--ui-space-4));padding:var(--ui-space-3);border:1px solid var(--border);border-radius:var(--ui-card-radius);background:var(--bg-card);color:var(--text-primary);box-shadow:var(--shadow-lg);font:inherit}
.pending-category-picker::backdrop{background:transparent}
.pending-category-picker>header{display:flex;align-items:center;justify-content:space-between;gap:var(--ui-space-2);margin-bottom:var(--ui-space-2)}
.pending-category-picker h2{margin:0;font-size:var(--ui-section-title-size);line-height:1.4}
.pending-category-picker input{width:100%;min-width:0;font:inherit}
.pending-category-options{display:grid;gap:4px;max-height:40dvh;overflow-y:auto;overscroll-behavior:contain;margin-top:var(--ui-space-2)}
.pending-category-option.btn{display:flex;justify-content:space-between;gap:var(--ui-space-2);width:100%;min-height:var(--ui-control-height);height:auto;padding:var(--ui-space-2);text-align:left;white-space:normal;overflow-wrap:anywhere;font-size:14px;line-height:1.5}
.pending-category-option[aria-pressed=true]{background:var(--accent-dim);color:var(--ui-primary);font-weight:600}
.pending-category-option[aria-pressed=true]::after{content:'✓';flex-shrink:0}
.pending-category-option[data-category-id="0"]{border-bottom:1px solid var(--border);border-radius:0}
.pending-category-option[hidden]{display:none}
.pending-category-status,.pending-category-empty{margin:var(--ui-space-2) 0 0;font-size:13px;line-height:1.5;color:var(--text-secondary)}
@media(max-width:600px){.pending-category-picker{left:0;right:0;bottom:0;top:auto;width:100%;max-width:100%;max-height:85dvh;border-radius:var(--ui-hero-radius) var(--ui-hero-radius) 0 0;padding-bottom:max(var(--ui-space-3),env(safe-area-inset-bottom))}.pending-category-picker::backdrop{background:rgba(0,0,0,.3)}.pending-category-options{max-height:45dvh}}
.pending-category-picker .modal-close{position:static;flex:0 0 var(--ui-control-height);width:var(--ui-control-height);padding:0;font-size:22px}
.pending-category-feedback .btn{width:auto;flex:0 0 auto;padding-inline:var(--ui-space-1)}

.pending-category-picker{overflow-y:auto}
.pending-category-status.money-negative{color:var(--expense)}
