/* 流水对碰（/#bank-recon）。颜色只用 tokens.css 变量（UI 门禁）。规则由 /api/bank-recon 随数据返回（app/bank_recon.py）。 */
[hidden] { display: none !important; }
body { background: var(--canvas); color: var(--text-primary); margin: 0; }
.br-app { margin: 0 auto; padding: 20px 16px 48px; max-width: 1440px; }
.br-head h1 { margin: 0 0 4px; font-size: 22px; }
.br-head p { margin: 0 0 6px; color: var(--text-muted); font-size: 13px; line-height: 1.6; max-width: 860px; }
.br-empty { padding: 24px; color: var(--text-muted); text-align: center; }
.br-dim { color: var(--text-muted); font-size: 12px; }
.br-bad { color: var(--danger-fg); }
.br-warn { color: var(--warning-fg); }
.br-ok { color: var(--success-fg); }
.br-err { color: var(--danger-fg); background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 8px; padding: 6px 10px; }
.br-mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; }

.br-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.br-fresh { color: var(--text-muted); font-size: 12px; }
.br-up-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--text-on-accent); cursor: pointer; white-space: nowrap; margin-left: auto; }
.br-up-btn:hover { background: var(--accent-hover); }
.br-btn { font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent);
  cursor: pointer; white-space: nowrap; }
.br-btn:hover { background: var(--accent); color: var(--text-on-accent); }
.br-btn.sm { padding: 2px 8px; font-size: 11px; }
.br-link { font: inherit; font-size: 12px; border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; white-space: nowrap; }
.br-link:hover { text-decoration: underline; }
.br-primary { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--text-on-accent); cursor: pointer; white-space: nowrap; }
.br-primary:disabled { opacity: .45; cursor: default; }

.br-sec { margin: 18px 0 8px; }
.br-sec-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.br-sec-h h2 { font-size: 16px; margin: 0; white-space: nowrap; }
.br-sec-h h2 small { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.br-sec-h select, .br-sec-h input[type="search"] { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-primary); }
.br-sec-h input[type="search"] { width: 200px; }
.br-guide { padding: 8px 12px; margin: 0 0 8px; border-radius: 8px; font-size: 13px; background: var(--info-bg); color: var(--info-fg); line-height: 1.6; }

.br-pill { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 6px; white-space: nowrap; background: var(--surface-sunken); color: var(--text-secondary); }
.br-pill.bad { background: var(--danger-bg); color: var(--danger-fg); }
.br-pill.warn { background: var(--warning-bg); color: var(--warning-fg); }
.br-pill.good { background: var(--success-bg); color: var(--success-fg); }
.br-pill.muted { background: var(--surface-sunken); color: var(--text-muted); }

/* 表：不包横向滚动框（包了表头就钉不住）；列宽定死，一格一行 */
.br-wrap { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.br-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
.br-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-sunken); color: var(--text-secondary); font-weight: 600;
  font-size: 12px; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-table thead th:first-child { border-top-left-radius: 10px; }
.br-table thead th:last-child { border-top-right-radius: 10px; }
.br-table th.c-num, .br-table td.num { text-align: right; }
.br-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.br-table td.num b, .br-table td.num { font-variant-numeric: tabular-nums; }
.br-table tbody tr:last-child td { border-bottom: 0; }
.br-table tbody tr[data-id], .br-table tbody tr[data-acct-row] { cursor: pointer; }
.br-table tbody tr:hover td { background: var(--surface-hover); }
.br-table tbody tr.on td { background: var(--accent-soft-bg); }
.br-table td small { display: block; color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-table tr.lv-bad td:first-child { box-shadow: inset 3px 0 0 var(--danger-fg); }
.br-table tr.lv-warn td:first-child { box-shadow: inset 3px 0 0 var(--warning-fg); }
.br-ell { overflow: hidden; text-overflow: ellipsis; }
.br-res .br-short { color: var(--text-secondary); }
.br-sug { color: var(--info-fg) !important; }
.br-go { color: var(--accent); font-size: 12px; }
.br-acct col.c-an { width: 24%; } .br-acct col.c-sp { width: 14%; } .br-acct col.c-st { width: 70px; } .br-acct col.c-n { width: 80px; }
.br-acct col.c-look { width: 15%; } .br-acct col.c-bal { width: 120px; } .br-acct col.c-diff { width: 128px; } .br-acct col.c-op { width: 84px; }
.br-an b { display: block; overflow: hidden; text-overflow: ellipsis; }
.br-lines col.c-d { width: 64px; } .br-lines col.c-a { width: 14%; } .br-lines col.c-cp { width: 18%; } .br-lines col.c-memo { width: 16%; }
.br-lines col.c-amt { width: 110px; } .br-lines col.c-res { width: auto; } .br-lines col.c-mk { width: 84px; }
.br-mini { font-size: 12px; table-layout: auto; }
.br-mini td { padding: 4px 6px; }

/* 右边详情 */
.br-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 94vw); background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3); z-index: 30; overflow-y: auto; }
.br-panel-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.br-close { font: inherit; font-size: 20px; line-height: 1; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 2px 6px; }
.br-panel-b { padding: 4px 16px 24px; font-size: 13px; }
.br-panel-b h3 { font-size: 15px; margin: 12px 0 4px; }
.br-panel-b h4 { font-size: 13px; margin: 14px 0 4px; }
.br-panel-b h4.bad { color: var(--danger-fg); }
.br-panel-b h4.warn { color: var(--warning-fg); }
.br-panel-b h4.good { color: var(--success-fg); }
.br-panel-b a { color: var(--accent); }
.br-dl { display: grid; grid-template-columns: 72px 1fr; gap: 6px 10px; margin: 8px 0; }
.br-dl dt { color: var(--text-muted); }
.br-dl dd { margin: 0; line-height: 1.5; word-break: break-all; }
.br-plist { margin: 0; padding-left: 18px; }
.br-plist li { margin: 4px 0; line-height: 1.5; }
.br-plist li small { display: block; color: var(--text-muted); }
.br-ups li.undone { color: var(--text-muted); text-decoration: line-through; }
.br-ups li.undone small { text-decoration: none; }
.br-sugbox { padding: 6px 10px; border-radius: 8px; background: var(--info-bg); color: var(--info-fg); }
.br-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.br-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.br-form select, .br-form textarea, .br-form input[type="file"] { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-primary); }
.br-seg { display: flex; gap: 14px; flex-wrap: wrap; }
.br-seg label { flex-direction: row; align-items: center; gap: 4px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.br-form-f { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* 两个标签：余额总览（bank-balance.js）/ 流水对碰（bank-recon.js） */
.br-views { display: inline-flex; gap: 0; margin: 8px 0 2px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.br-views button { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 18px; border: 0; background: transparent; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap; }
.br-views button + button { border-left: 1px solid var(--border); }
.br-views button:hover { background: var(--surface-hover); }
.br-views button.on { background: var(--accent); color: var(--text-on-accent); }

/* 余额总览 */
.bb-acct col.c-an { width: 24%; } .bb-acct col.c-bal { width: 150px; } .bb-acct col.c-amt { width: 120px; } .bb-acct col.c-last { width: 80px; }
.bb-acct col.c-stmt { width: 15%; } .bb-acct col.c-look { width: 12%; }
.bb-shop col.c-an { width: 32%; } .bb-shop col.c-bal { width: 170px; } .bb-shop col.c-amt { width: 130px; } .bb-shop col.c-last { width: 90px; }
.bb-bal b { font-size: 14px; }
.bb-bal.neg b { color: var(--danger-fg); }
.bb-bar { display: block; height: 4px; margin-top: 3px; border-radius: 2px; background: var(--surface-sunken); overflow: hidden; }
.bb-bar i { display: block; height: 100%; background: var(--accent); opacity: .55; margin-left: auto; }
.bb-iss { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin: 0 0 8px; }
.bb-iss.lv-bad { border-left: 4px solid var(--danger-fg); }
.bb-iss.lv-warn { border-left: 4px solid var(--warning-fg); }
.bb-iss > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 14px; }
.bb-iss > summary::-webkit-details-marker { display: none; }
.bb-iss > summary::before { content: "▸"; color: var(--text-muted); font-size: 12px; }
.bb-iss[open] > summary::before { content: "▾"; }
.bb-iss-n { font-variant-numeric: tabular-nums; color: var(--text-primary); white-space: nowrap; }
.bb-eff { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.bb-iss .br-wrap { border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0 0 10px 10px; }
.bb-iss .br-table thead th { border-radius: 0 !important; }
.bb-iss > .br-dim { padding: 6px 12px; margin: 0; }
.bb-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 8px; }
.bb-chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--warning-bg); color: var(--warning-fg); white-space: nowrap; }
.bb-chip.info { background: var(--surface-sunken); color: var(--text-muted); }
.bb-irows col.c-d { width: 56px; } .bb-irows col.c-a { width: 15%; } .bb-irows col.c-src { width: 72px; } .bb-irows col.c-amt { width: 110px; }
.bb-irows col.c-what { width: 20%; } .bb-irows col.c-why { width: auto; } .bb-irows col.c-go { width: 96px; }
.bb-acct-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.bb-why { color: var(--text-secondary); }
.bb-irows tr.bb-band td { background: var(--surface-sunken); }
.bb-flows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bb-flow { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px 14px; min-width: 0; }
.bb-flow h3 { font-size: 13px; margin: 0 0 8px; color: var(--text-secondary); }
.bb-note { font-size: 12px; margin: 8px 0 0; }
.bb-shops > summary { list-style: none; cursor: pointer; margin-bottom: 8px; }
.bb-shops > summary::-webkit-details-marker { display: none; }
.bb-shops > summary h2 { display: inline; font-size: 16px; margin: 0; }
.bb-shops > summary h2::before { content: "▸ "; color: var(--text-muted); font-size: 12px; }
.bb-shops[open] > summary h2::before { content: "▾ "; }
.bb-shops > summary h2 small { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.bb-big { font-size: 26px; font-weight: 700; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.bb-how { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 6px 0; max-width: 460px; }
.bb-how dt { color: var(--text-secondary); }
.bb-how dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.bb-how .bb-eq { border-top: 1px solid var(--border); padding-top: 4px; font-weight: 700; color: var(--text-primary); }
.bb-mon { max-width: 460px; }
.bb-mon td, .bb-mon th { padding: 4px 8px; }
.bb-items col.c-d { width: 52px; } .bb-items col.c-src { width: 64px; } .bb-items col.c-amt { width: 104px; } .bb-items col.c-who { width: 26%; }
.bb-items col.c-what { width: auto; } .bb-items col.c-by { width: 60px; } .bb-items col.c-go { width: 24px; }
#bb-panel { width: min(640px, 96vw); }

@media (max-width: 1100px) {
  .bb-flows { grid-template-columns: 1fr; }
  .br-wrap { overflow-x: auto; }
  .br-table { min-width: 980px; }
  .br-mini { min-width: 0; }
  .bb-mon, .bb-items { min-width: 0; }
  #bb-panel .br-table { min-width: 0; }
}
