/* bank-csv - "Statement lines" page and its sheets (opt-in key bankCsvImport). New-UI vocabulary: bold sans title over a small
   uppercase eyebrow (.rm2-title / .rm2-eyebrow), a coloured KPI row with icon tiles (.rm2-kpis), bold uppercase labels, white
   rounded fields, pill pickers (no native selects), wide on desktop, a slim sheet on phone. Tokens only (light and dark). */
#nav-statement-lines-item:not(.bsl-nav-on) { display: none !important; }

/* ── page ── */
#page-statement-lines.rm2 .rm2-wrap { max-width: 1240px; margin: 0 auto; }
.bsl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.bsl-head .rm2-lede { max-width: 62ch; }
.bsl-head-act { display: flex; gap: 10px; flex-wrap: wrap; }
.bsl-btn { min-height: 46px; padding: 0 20px; border-radius: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.bsl-btn svg { width: 16px; height: 16px; }
.bsl-btn.btn-gold { background: var(--blue, var(--gold)) !important; border-color: var(--blue, var(--gold)) !important; color: #fff !important; box-shadow: 0 6px 16px color-mix(in srgb, var(--blue, var(--gold)) 26%, transparent); }
.rm2-kpi[data-k="ignored"] .rm2-kpi-ic { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.rm2-kpi[data-k="trip"] .rm2-kpi-value { color: var(--white); }
.bsl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.bsl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 16px; }
.bsl-search { position: relative; flex: 1 1 100%; }
.bsl-search-ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; pointer-events: none; }
.bsl-search-ic svg { width: 17px; height: 17px; }
.bsl-search input { width: 100%; min-height: 48px; padding: 0 16px 0 44px !important; border-radius: 12px !important; border: 1px solid var(--border) !important; background: var(--bg-raised) !important; color: var(--white) !important; font-size: 15px !important; box-shadow: none !important; }
.bsl-search input:focus { border-color: var(--blue, var(--gold)) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue, var(--gold)) 16%, transparent) !important; outline: 0; }
.bsl-seg { display: flex !important; flex-wrap: wrap !important; gap: 4px; margin: 0 !important; padding: 5px !important; border-radius: 16px !important; width: fit-content; max-width: 100%; }
.bsl-seg .inv-kind-tab { flex: 0 1 auto !important; min-height: 42px !important; padding: 0 16px !important; font-size: 14px !important; font-weight: 600 !important; white-space: nowrap; border-radius: 12px !important; }
.bsl-seg-sub .inv-kind-tab { min-height: 38px !important; font-size: 13px !important; }
.bsl-pc { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; background: color-mix(in srgb, currentColor 12%, transparent); }

.bsl-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; min-width: 0; }
.bsl-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.bsl-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0; background: var(--bg-void, rgba(0,0,0,.06)); color: var(--off-white); vertical-align: 1px; }
.bsl-empty { padding: 28px 22px; color: var(--off-white); font-size: 14.5px; line-height: 1.5; }
.bsl-more { padding: 14px 22px 18px; text-align: center; border-top: 1px solid var(--border); }
.bsl-first { padding: 40px 28px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.bsl-first-ic { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 10%, transparent); }
.bsl-first-ic svg { width: 26px; height: 26px; }
.bsl-first-t { font-size: 20px; font-weight: 700; color: var(--white); }
.bsl-first-s { max-width: 58ch; font-size: 14.5px; line-height: 1.55; color: var(--off-white); }

/* ── rows (desktop table look, phone cards) ── */
.bsl-th, .bsl-row { display: grid; grid-template-columns: 116px minmax(0, 1.2fr) 118px minmax(0, 1.5fr) 18px; gap: 18px; align-items: center; padding: 0 22px; }
.bsl-th { min-height: 40px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--off-white); background: var(--bg-void, transparent); }
.bsl-r { text-align: right; }
.bsl-row { width: 100%; min-height: 76px; padding-top: 12px; padding-bottom: 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--white); font: inherit; text-align: left; cursor: pointer; }
.bsl-rows .bsl-row:last-child { border-bottom: 0; }
.bsl-row:hover { background: color-mix(in srgb, var(--blue, var(--gold)) 4%, transparent); }
.bsl-row:focus-visible { outline: 2px solid var(--blue, var(--gold)); outline-offset: -2px; }
.bsl-d { font-size: 13.5px; font-weight: 600; color: var(--off-white); white-space: nowrap; }
.bsl-l { display: grid; gap: 4px; min-width: 0; }
.bsl-l-t { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsl-l-s { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--off-white); }
.bsl-l-s svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.bsl-a { text-align: right; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bsl-a.is-neg { color: var(--green); }
.bsl-m { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.bsl-m-k { font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue, var(--gold)); }
.bsl-m-t { font-size: 14px; font-weight: 600; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsl-m-s { font-size: 12.5px; color: var(--off-white); line-height: 1.35; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsl-go { color: var(--muted); display: flex; }
.bsl-go svg { width: 14px; height: 14px; }
.bsl-row.is-ignored .bsl-l-t, .bsl-row.is-ignored .bsl-a { color: var(--muted); }
.bsl-chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.bsl-chip svg { width: 12px; height: 12px; flex: 0 0 12px; }
.bsl-chip.is-ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.bsl-chip.is-auto { color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 11%, transparent); }
.bsl-chip.is-warn { color: var(--amber, var(--gold)); background: color-mix(in srgb, var(--amber, var(--gold)) 14%, transparent); }
.bsl-chip.is-mute { color: var(--off-white); background: var(--bg-void, rgba(0,0,0,.06)); }
.bsl-wrap mark.wf-hl { background: color-mix(in srgb, var(--gold) 30%, transparent); color: inherit; border-radius: 3px; }

@media (max-width: 900px) {
  .bsl-th { display: none; }
  .bsl-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l a" "d d" "m m"; gap: 6px 12px; padding: 14px 16px; }
  .bsl-l { grid-area: l; } .bsl-a { grid-area: a; align-self: start; } .bsl-d { grid-area: d; } .bsl-m { grid-area: m; padding-top: 6px; border-top: 1px dashed var(--border); width: 100%; }
  .bsl-go { display: none; }
  .bsl-l-t { white-space: normal; }
  .bsl-m-t, .bsl-m-s { white-space: normal; }
}
@media (max-width: 600px) {
  .bsl-head { margin-bottom: 14px; }
  .bsl-head-act { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .bsl-btn { padding: 0 12px; }
  .bsl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bsl-card-head { padding: 14px 16px 10px; }
  .bsl-seg { width: 100%; }
  .bsl-seg { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bsl-seg-sub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bsl-seg-sub .inv-kind-tab:first-child { grid-column: 1 / -1; }
  .bsl-seg .inv-kind-tab { justify-content: center; padding: 0 6px !important; font-size: 13.5px !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .bsl-seg .bsl-pc { display: none; }
}

/* ── sheets ── */
.bc-modal { position: relative; --bc-px: 34px; --bc-pb: 26px; }
.loan-form-modal.bc-modal .modal-title::before { content: none !important; }
.bc-modal .modal-sub { max-width: 780px; }
.bc-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--off-white); margin-bottom: 4px; }
.bc-modal .modal-title { font-family: var(--font-body) !important; font-weight: 700 !important; letter-spacing: -0.4px; }
.bc-x { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; min-height: 44px !important; border-radius: 50% !important; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.bc-x svg { width: 16px; height: 16px; }
.bc-x:hover { border-color: var(--blue, var(--gold)); }
.bc-loading { padding: 48px 8px; text-align: center; color: var(--off-white); font-size: 14px; }
.bc-modal .lf-sum { margin-top: 4px; }
.bc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.bc-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.bc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.bc-card-title { margin: 0; display: flex; align-items: center; gap: 8px; font-family: inherit !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1.4px !important; text-transform: uppercase; color: var(--white); line-height: 1.3; }
.bc-count { font-size: 11px; font-weight: 700; letter-spacing: 0; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-void, rgba(0,0,0,.06)); color: var(--off-white); }
.bc-sub { font-size: 12.5px; color: var(--off-white); }
.bc-card-body { padding: 16px 20px 18px; }
.bc-link { border: 0; background: transparent; padding: 4px 2px; min-height: 32px; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue, var(--gold)); cursor: pointer; }
.bc-link:hover { text-decoration: underline; }
.bc-note, .bc-hint { font-size: 13px; line-height: 1.5; color: var(--off-white); margin-top: 12px; }
.bc-card-body > .bc-note { margin-top: 0; }
.bc-hint { margin-top: 8px; }
.bc-hint.is-warn { color: var(--amber, var(--gold)); font-weight: 600; }
.bc-empty { padding: 18px 4px; color: var(--off-white); font-size: 14px; line-height: 1.5; }
.bc-sep { margin: 14px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* candidates */
.bc-cands { display: grid; }
.bc-cand { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.bc-cands > .bc-cand:last-child, .bc-cand.is-current { border-bottom: 0; }
.bc-cand-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 10%, transparent); }
.bc-cand.is-current .bc-cand-ic { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.bc-cand-ic svg { width: 18px; height: 18px; }
.bc-cand-b { display: grid; gap: 3px; min-width: 0; }
.bc-cand-t { font-size: 15px; font-weight: 600; color: var(--white); line-height: 1.3; }
.bc-cand-s { font-size: 12.5px; color: var(--off-white); line-height: 1.4; }
.bc-cand-r { display: flex; align-items: center; gap: 14px; }
.bc-cand-amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-cand-btn { min-height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 600; }
.bc-cand-btn.btn-gold { background: var(--blue, var(--gold)) !important; border-color: var(--blue, var(--gold)) !important; color: #fff !important; }
.bc-search { position: relative; margin-bottom: 10px; }
.bc-search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; pointer-events: none; }
.bc-search-ic svg { width: 17px; height: 17px; }
.bc-modal input[type="search"], .bc-modal input[type="text"], .bc-modal input[type="date"] { width: 100%; min-height: 48px; border-radius: 12px !important; border: 1px solid var(--border) !important; background: var(--bg-void, var(--bg-raised)) !important; color: var(--white) !important; font-size: 15px !important; padding: 0 14px !important; box-shadow: none !important; font-family: inherit; }
.bc-modal input.bc-q { padding-left: 44px !important; }
.bc-modal input:focus { border-color: var(--blue, var(--gold)) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue, var(--gold)) 16%, transparent) !important; outline: 0; }

/* fields + pill pickers */
.bc-fields { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.bc-fields .form-group { margin: 0; min-width: 0; }
.bc-fields label { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--white); }
.bc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.bc-chip em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--green); }
.bc-chip:hover { border-color: var(--blue, var(--gold)); }
.bc-chip.on { background: var(--blue, var(--gold)); border-color: var(--blue, var(--gold)); color: #fff; }
.bc-chip.on em { color: #fff; opacity: .85; }
.bc-catg + .bc-catg { margin-top: 12px; }
.bc-catg-t { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--off-white); }

/* import */
.bc-drop { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 40px 20px; border: 2px dashed var(--border); border-radius: 14px; background: var(--bg-void, transparent); cursor: pointer; }
.bc-drop:hover, .bc-drop.is-over { border-color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 5%, transparent); }
.bc-drop-ic { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 10%, transparent); }
.bc-drop-ic svg { width: 24px; height: 24px; }
.bc-drop-t { font-size: 18px; font-weight: 700; color: var(--white); }
.bc-drop-s { max-width: 46ch; font-size: 13.5px; line-height: 1.5; color: var(--off-white); }
.bc-prev { display: grid; }
.bc-prev-r { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bc-prev-r:last-child { border-bottom: 0; }
.bc-prev-r.is-dup { opacity: .55; }
.bc-prev-d { font-size: 12.5px; font-weight: 600; color: var(--off-white); }
.bc-prev-t { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: grid; gap: 2px; }
.bc-prev-t em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--off-white); }
.bc-prev-a { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bc-prev-a.is-neg { color: var(--green); }

.bc-err { min-height: 0; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--red, #d64545); }
.bc-err:empty { display: none; }
.bc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 20px calc(-1 * var(--bc-px)) calc(-1 * var(--bc-pb)); padding: 12px var(--bc-px) calc(12px + var(--bc-pb)); border-top: 1px solid var(--border); background: var(--bg-panel); position: sticky; bottom: calc(-1 * var(--bc-pb)); z-index: 3; }
.bc-foot-r { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.bc-foot .btn { min-height: 46px; padding: 0 22px; border-radius: 12px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.bc-foot .btn svg { width: 15px; height: 15px; }
.bc-foot .btn-gold { background: var(--blue, var(--gold)) !important; border-color: var(--blue, var(--gold)) !important; color: #fff !important; box-shadow: 0 6px 16px color-mix(in srgb, var(--blue, var(--gold)) 28%, transparent); }
.bc-foot .btn[disabled] { opacity: .45; box-shadow: none; cursor: not-allowed; }
.bc-undo { color: var(--off-white) !important; }

@media (min-width: 900px) {
  .loan-form-modal.bc-modal { width: min(1080px, 94vw) !important; max-width: 1080px !important; }
  .bc-v-line .lf-sum, .bc-v-import .lf-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bc-v-import.bc-i-map .bc-grid-2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .bc-v-import.bc-i-map .bc-grid-2 > .bc-card:last-child { position: sticky; top: 0; }
  .bc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
  .bc-fields .bc-span2 { grid-column: 1 / -1; }
  .bc-v-import.bc-i-map .bc-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .bc-modal { --bc-px: 18px; --bc-pb: 20px; }
  .bc-x { top: 12px; right: 12px; }
  .bc-card-body { padding: 14px 14px 16px; }
  .bc-card-head { padding: 14px 14px 10px; }
  .bc-cand { grid-template-columns: 38px minmax(0, 1fr); }
  .bc-cand-r { grid-column: 1 / -1; justify-content: space-between; padding-left: 52px; }
  .bc-cand-btn { min-width: 112px; }
  .bc-foot { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .bc-foot-r { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .bc-foot .btn { width: 100%; }
  .bc-foot-r .btn-gold { grid-column: 1 / -1; order: -1; }
  .bc-foot-r > .btn:not(.btn-gold):first-child:nth-last-child(2) { grid-column: 1 / -1; }
  .bc-foot-l { order: 3; }
  .bc-foot-l:empty { display: none; }
  /* two buttons (Back + Create expense, Close + one action): one row, the main one wider (Hal 10-14: no stacked pair) */
  .bc-foot-r:has(> .btn:first-child:nth-last-child(2)) { grid-template-columns: auto 1fr; }
  .bc-foot-r:has(> .btn:first-child:nth-last-child(2)) > .btn { grid-column: auto !important; order: 0 !important; padding: 0 18px; }
  .bc-undo { width: 100%; }
}

/* columns read (summary) */
.bc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.bc-col { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-void, transparent); min-width: 0; }
.bc-col-k { font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--off-white); }
.bc-col-v { font-size: 14px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── runner card charges (opt-in key runnerCardCharges) ── */
.bsl-runner { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--blue, var(--gold)) 14%, transparent); color: var(--blue, var(--gold)); font-size: 11.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.bc-rc-find { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised); margin-bottom: 10px; }
.bc-rc-find:focus-within { border-color: var(--blue, var(--gold)); }
.bc-rc-ic svg { width: 18px; height: 18px; color: var(--muted); display: block; }
.bc-rc-in { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--white); font: inherit; font-size: 15px; outline: none; }
.bc-rc .bc-chip svg { width: 14px; height: 14px; }
.bc-rc-rule { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--off-white); }
