/* Bank Accounts for Non-Residents: page-specific pieces on top of the UAE Savings / Bonds / Mortgages stack */
.logo.flag { object-fit: cover; border-radius: 3px; }
.b-banks small { display: block; color: var(--text-dim); font-size: 0.8rem; margin: 2px 0 6px; line-height: 1.4; }
.b-val small.res-line { display: block; margin-top: 3px; font-size: 0.72rem; font-weight: 400; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.fee.unk { color: var(--text-dim); }

/* Best-for cards: flags next to winners and runners-up */
#picks .cat-win .cat-model { display: flex; align-items: center; gap: 10px; }
#picks .cat-win .logo.flag { width: 32px; height: 24px; margin: 0; flex: none; border-radius: 5px; }
#picks .cat-run .logo.flag { width: 22px; height: 16px; margin: 0; flex: none; border-radius: 3px; }

/* Leaderboard: who can apply, right under the bank name */
.b-elig { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 3px; }
.b-elig .elig-k { color: var(--text-muted); font-weight: 600; }

/* Rebalanced widths: the Open pill needs less room, Min and Fees need more.
   Header and rows share this one grid, and every data column centers the same way. */
#section-board .board-head, #section-board .b-row {
  grid-template-columns: 36px minmax(170px, 1.1fr) minmax(0, 0.6fr) 150px 170px 90px 90px;
  column-gap: 10px;
}
#section-board .board-head .sort-btn { justify-self: center; }
#section-board .board-head .sort-btn, #section-board .board-head > span { white-space: nowrap; }
#section-board .b-row .b-bar.apr-bar { justify-content: center; }
#section-board .b-fee.term small { max-width: 185px; overflow: hidden; text-overflow: ellipsis; }

/* Safety grade pill */
.safe-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.safe-pill .bi { font-size: 0.85rem; }
.safe-pill.A { color: #4be08c; border-color: rgba(46, 204, 113, 0.4); background: rgba(46, 204, 113, 0.12); }
.safe-pill.B { color: #ffbe3d; border-color: rgba(255, 170, 0, 0.4); background: rgba(255, 170, 0, 0.1); }
.safe-pill.C { color: #ff8080; border-color: rgba(230, 103, 103, 0.45); background: rgba(230, 103, 103, 0.12); }
:root[data-theme="light"] .safe-pill.A { color: #047857; border-color: rgba(4, 120, 87, 0.4); background: rgba(16, 185, 129, 0.14); }
:root[data-theme="light"] .safe-pill.B { color: #b45309; border-color: rgba(180, 83, 9, 0.4); background: rgba(245, 158, 11, 0.14); }
:root[data-theme="light"] .safe-pill.C { color: #dc2626; border-color: rgba(220, 38, 38, 0.4); background: rgba(220, 38, 38, 0.08); }

@media (max-width: 768px) {
  #section-board .board-head, #section-board .b-row { grid-template-columns: 26px 1fr 1fr 1fr; }
  #section-board .b-row .b-fee .fee { white-space: normal; line-height: 1.3; }
  #section-board .b-fee.safe { display: none; }
}

/* Open column: access pill instead of a bar */
#board .b-bar.apr-bar { height: auto; }
#board .b-bar.apr-bar .b-fill.apr { display: none; }
#board .b-bar.apr-bar .b-val { margin-left: 0; }
#board .b-bar.apr-bar .open-pill { font-size: 0.78rem; padding: 5px 12px; border-radius: 999px; }
#board .b-bar.apr-bar .open-pill .bi { margin-right: 6px; }

/* Row links: bank name to homepage, fee value to the fee schedule */
#board .b-row .b-link { color: inherit; text-decoration: none; }
#board .b-row .b-link:hover { color: var(--accent); }
#board .b-fee .fee-link { text-decoration: none; }
#board .b-fee .fee-link:hover { filter: brightness(1.25); }
