/* ============================================================================
   GSB JB TTM Bridge — true trailing-12 to the CFO's adjusted P&L (Jack Brown's).
   #jb-bridge-screen only. Ported from the published artifact; every rule is ID-scoped
   and every table cell / form control sets its own box so style.css's global
   label / select / input / table / th / td rules can't leak in. Colors come from
   gsb-tokens.css; negative = clay (never red). Exec-tier tab (access-scope.js).
   ========================================================================= */

#jb-bridge-screen {
  --bg: var(--gsb-paper); --surface: #FBF8F1; --ink: var(--gsb-soil-ink); --muted: var(--gsb-stone); --faint: #8A8171;
  --line: var(--gsb-oat-dk); --oat: var(--gsb-oat); --total: #EDE7DA; --green: var(--gsb-shoot-green); --leaf: var(--gsb-leaf);
  --ochre: var(--gsb-ochre); --on-ochre: #fff; --wash: #F2E7C8; --clay: var(--gsb-clay);
  --good-bg: rgba(47, 107, 69, .15); --bad-bg: rgba(181, 83, 46, .16); --hdr: var(--gsb-soil-ink); --stone: var(--gsb-stone); --focus: var(--gsb-shoot-green);
  font-family: var(--font-body); color: var(--ink);
}

/* GSB.<Page> title wordmark — self-contained (Monday Scan / Usage pattern; no edit to gsb-sales-flash.css) */
#jb-bridge-screen .nav-bar h2 {
  font-family: var(--font-body) !important; font-weight: 700 !important; font-size: 22px !important;
  letter-spacing: -0.04em !important; color: var(--gsb-soil-ink) !important;
  display: flex; align-items: baseline; gap: 2px; margin: 0;
}
#jb-bridge-screen .nav-bar h2 .gsb-title-mark { flex: 0 0 auto; color: var(--gsb-soil-ink); }
#jb-bridge-screen .nav-bar h2 .gsb-title-dot { color: var(--gsb-leaf); }
#jb-bridge-screen .nav-bar h2 .gsb-kw {
  color: var(--gsb-soil-ink) !important;
  background: linear-gradient(transparent 58%, rgba(130, 187, 144, 0.50) 58%) !important;
  padding: 0 2px; border-radius: 1px;
}
#jb-bridge-screen .jbb-tagline { font-size: 11px; color: var(--gsb-stone); }

#jb-bridge-screen #jb-bridge-root { max-width: 1400px; margin: 0 auto; padding: 8px 16px 72px; font-size: 14px; line-height: 1.45; }
#jb-bridge-screen .jbb-loading { color: var(--gsb-stone); padding: 40px 4px; text-align: center; font-size: 13.5px; }

/* ── leak guards: style.css has bare label/select/input/table/th/td rules ─── */
#jb-bridge-screen label { display: inline; margin: 0; text-transform: none; letter-spacing: 0; font-size: inherit; font-weight: inherit; color: inherit; }
#jb-bridge-screen select, #jb-bridge-screen input, #jb-bridge-screen textarea { width: auto; box-shadow: none; transition: none; }
#jb-bridge-screen input[type="checkbox"] { padding: 0; border: 0; }
#jb-bridge-screen table { width: 100%; min-width: 0; border-collapse: collapse; }
#jb-bridge-screen th, #jb-bridge-screen td { text-align: left; font-size: inherit; color: inherit; border-bottom: 0; padding: 0; }
#jb-bridge-screen tr:last-child td { border-bottom: 0; }
#jb-bridge-screen button { font-family: inherit; }

#jb-bridge-screen *{box-sizing:border-box}
#jb-bridge-screen button,
#jb-bridge-screen select,
#jb-bridge-screen input,
#jb-bridge-screen textarea{font:inherit;color:inherit}
#jb-bridge-screen button{cursor:pointer}
#jb-bridge-screen :focus-visible{outline:2px solid var(--focus);outline-offset:2px}
#jb-bridge-screen .mono{font-family:var(--font-mono)}
#jb-bridge-screen .mast{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:flex-end;justify-content:space-between;padding-bottom:16px}
#jb-bridge-screen .sub{color:var(--muted);margin:6px 0 0;font-size:13px;max-width:70ch}
#jb-bridge-screen .chips{display:flex;flex-wrap:wrap;gap:8px}
#jb-bridge-screen .chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:4px 11px;font-size:12px;color:var(--muted);background:var(--surface)}
#jb-bridge-screen .chip b{color:var(--ink);font-weight:600}
#jb-bridge-screen .chip.ok::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--green)}
#jb-bridge-screen .chip.warn::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--ochre)}
#jb-bridge-screen .tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:12px;margin-bottom:16px}
#jb-bridge-screen .tile{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:14px 16px 13px;min-width:0}
#jb-bridge-screen .tile .k{font:500 11px/1 var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
#jb-bridge-screen .tile .big{font:500 34px/1.1 var(--font-display);letter-spacing:-.01em;margin:8px 0 6px;font-variant-numeric:tabular-nums}
#jb-bridge-screen .tile .row{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}
#jb-bridge-screen .tile .row b{color:var(--ink);font-weight:600}
#jb-bridge-screen .tile .up{color:var(--green);font-weight:600}
#jb-bridge-screen .tile .dn{color:var(--clay);font-weight:600}
#jb-bridge-screen .ctl{display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center;margin-bottom:12px}
#jb-bridge-screen .grp{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#jb-bridge-screen .grp>label,
#jb-bridge-screen .grp>.lab{font:500 11px/1 var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
#jb-bridge-screen .seg{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;background:var(--surface)}
#jb-bridge-screen .seg button{border:0;background:transparent;padding:6px 12px;font-size:12.5px;color:var(--muted);border-right:1px solid var(--line)}
#jb-bridge-screen .seg button:last-child{border-right:0}
#jb-bridge-screen .seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg);font-weight:600}
#jb-bridge-screen select.sel,
#jb-bridge-screen input.inp{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:12.5px}
#jb-bridge-screen .btn{border:1px solid var(--line);background:var(--surface);border-radius:6px;padding:5px 11px;font-size:12.5px}
#jb-bridge-screen .btn:hover{border-color:var(--muted)}
#jb-bridge-screen .notice{border:1px solid var(--ochre);background:var(--wash);border-radius:6px;padding:10px 14px;margin-bottom:14px;font-size:13px;display:flex;gap:10px 14px;flex-wrap:wrap;align-items:center;justify-content:space-between}
#jb-bridge-screen .notice b{font-weight:600}
#jb-bridge-screen .linkbtn{background:none;border:0;padding:0;color:var(--green);text-decoration:underline;text-underline-offset:2px;font-weight:600}
#jb-bridge-screen .tabs{background:var(--bg);display:flex;gap:2px;overflow-x:auto;border-bottom:1px solid var(--line);margin-bottom:16px;scrollbar-width:none}
#jb-bridge-screen .tabs::-webkit-scrollbar{display:none}
#jb-bridge-screen .tabs button{flex:0 0 auto;background:none;border:0;border-bottom:3px solid transparent;padding:11px 16px 9px;font-size:13.5px;color:var(--muted);font-weight:500}
#jb-bridge-screen .tabs button[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--green);font-weight:600}
#jb-bridge-screen .plgrid{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:20px;align-items:start}
#jb-bridge-screen .scroll{overflow-x:auto;border:1px solid var(--line);border-radius:6px;background:var(--surface)}
#jb-bridge-screen .pl{border-collapse:collapse;width:100%;min-width:640px;font-size:12.5px;font-variant-numeric:tabular-nums}
#jb-bridge-screen .pl th,
#jb-bridge-screen .pl td{height:27px;padding:0 10px;white-space:nowrap;border-bottom:1px solid var(--line);vertical-align:middle}
#jb-bridge-screen .pl thead th{color:#fff;font-weight:600;text-align:right;border-bottom:0;height:30px}
#jb-bridge-screen .pl thead th:first-child{text-align:left;background:var(--hdr)}
#jb-bridge-screen .pl th.h-true{background:var(--stone)}
#jb-bridge-screen .pl th.h-adj{background:var(--ochre);color:var(--on-ochre)}
#jb-bridge-screen .pl th.h-fin{background:var(--hdr)}
#jb-bridge-screen .pl th.h-chg{background:var(--stone)}
#jb-bridge-screen .pl td.lbl{text-align:left;font-weight:500;width:34%}
#jb-bridge-screen .pl td.n{text-align:right}
#jb-bridge-screen .pl td.wash{background:var(--wash)}
#jb-bridge-screen .pl td.good{background:var(--good-bg);color:var(--green);font-weight:600}
#jb-bridge-screen .pl td.bad{background:var(--bad-bg);color:var(--clay);font-weight:600}
#jb-bridge-screen .pl td.flat{color:var(--faint)}
#jb-bridge-screen .pl tr.total td{background:var(--total);font-weight:700}
#jb-bridge-screen .pl tr.total td.pos{color:var(--green)}
#jb-bridge-screen .pl tr.total td.neg{color:var(--clay)}
#jb-bridge-screen .pl tr.sec td{background:var(--stone);color:#fff;font-weight:600;height:24px;font-size:11.5px;letter-spacing:.02em}
#jb-bridge-screen .pl tr.acct td{height:23px;font-size:11.5px;color:var(--muted);border-bottom-color:transparent}
#jb-bridge-screen .pl tr.acct td.lbl{padding-left:26px;font-weight:400}
#jb-bridge-screen .pl tr.acct td .code{font-family:var(--font-mono);font-size:10.5px;color:var(--faint);margin-right:7px}
#jb-bridge-screen .pl tr.acct td.hit{color:var(--ink)}
#jb-bridge-screen .pl button.exp{background:none;border:0;padding:0 6px 0 0;color:var(--muted);font-size:10px}
#jb-bridge-screen .foot{font-size:12px;color:var(--muted);margin:10px 2px 0;max-width:90ch}
#jb-bridge-screen .foot sup{color:var(--ochre);font-weight:700}
#jb-bridge-screen .rail{background:var(--surface);border:1px solid var(--line);border-radius:6px;}
#jb-bridge-screen .rail h3{margin:0;padding:12px 14px 8px;font:500 11px/1 var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
#jb-bridge-screen .rail .cat{display:flex;align-items:center;gap:8px;padding:9px 14px 5px;font-weight:600;font-size:12.5px;border-top:1px solid var(--line)}
#jb-bridge-screen .rail .cat .amt{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:600;color:var(--muted)}
#jb-bridge-screen .rail .it{display:flex;align-items:center;gap:8px;padding:3px 14px 3px 16px;font-size:12.5px;line-height:1.3}
#jb-bridge-screen .rail .it label{display:flex;align-items:center;gap:8px;flex:1;min-width:0;cursor:pointer}
#jb-bridge-screen .rail .it .nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#jb-bridge-screen .rail .it .amt{font-variant-numeric:tabular-nums;color:var(--muted);flex:0 0 auto}
#jb-bridge-screen .rail .it.off .nm,
#jb-bridge-screen .rail .it.off .amt{opacity:.45;text-decoration:line-through}
#jb-bridge-screen .rail .tot{display:flex;justify-content:space-between;padding:10px 14px;border-top:1px solid var(--line);font-weight:600;font-variant-numeric:tabular-nums;background:var(--total)}
#jb-bridge-screen input[type=checkbox]{accent-color:var(--green);width:15px;height:15px;margin:0;flex:0 0 auto}
#jb-bridge-screen .ledger{min-width:1040px}
#jb-bridge-screen .lg{display:grid;grid-template-columns:30px minmax(250px,1.7fr) 52px 92px 92px 92px minmax(200px,1.5fr) 106px 38px;gap:0 10px;align-items:center;padding:7px 12px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
#jb-bridge-screen .lg.hd{background:var(--hdr);color:#fff;font:500 10.5px/1.2 var(--font-mono);letter-spacing:.07em;text-transform:uppercase;padding-block:9px;position:sticky;top:0}
#jb-bridge-screen .lg .r{text-align:right}
#jb-bridge-screen .lg.cat{background:var(--oat);font-weight:600}
#jb-bridge-screen .lg.cat .nm{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
#jb-bridge-screen .lg.cat small{font-weight:400;color:var(--muted)}
#jb-bridge-screen .lg.end{background:var(--total);font-weight:700}
#jb-bridge-screen .lg .nm{min-width:0}
#jb-bridge-screen .lg .nm b{font-weight:600;display:block}
#jb-bridge-screen .lg .nm span{display:block;color:var(--muted);font-size:12px}
#jb-bridge-screen .lg.off .nm,
#jb-bridge-screen .lg.off .r{opacity:.5}
#jb-bridge-screen .lg .pos{color:var(--green)}
#jb-bridge-screen .lg .neg{color:var(--clay)}
#jb-bridge-screen .lg .zero{color:var(--faint)}
#jb-bridge-screen .lg button.cnt{background:none;border:0;color:var(--green);text-decoration:underline;text-underline-offset:2px;padding:0;font-size:12.5px}
#jb-bridge-screen .track{position:relative;height:18px;background:linear-gradient(90deg,transparent calc(100% - 1px),var(--line) 0);border-radius:2px}
#jb-bridge-screen .bar{position:absolute;top:2px;height:14px;border-radius:2px;min-width:2px}
#jb-bridge-screen .bar.up{background:var(--green)}
#jb-bridge-screen .bar.dn{background:var(--clay)}
#jb-bridge-screen .bar.tot{background:var(--ink);opacity:.82}
#jb-bridge-screen .bar.base{background:var(--stone)}
#jb-bridge-screen .bar.ghost{background:transparent;border:1px dashed var(--faint)}
#jb-bridge-screen .st{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:3px 6px;font-size:12px;width:100%}
#jb-bridge-screen .st[data-v="Accepted"]{border-color:var(--green);color:var(--green)}
#jb-bridge-screen .st[data-v="Challenge"]{border-color:var(--clay);color:var(--clay)}
#jb-bridge-screen .st[data-v="Reviewing"]{border-color:var(--ochre);color:var(--ochre)}
#jb-bridge-screen .iconbtn{border:1px solid var(--line);background:var(--surface);border-radius:6px;width:30px;height:28px;padding:0;position:relative}
#jb-bridge-screen .iconbtn.has::after{content:"";position:absolute;top:3px;right:3px;width:7px;height:7px;border-radius:50%;background:var(--ochre)}
#jb-bridge-screen .extra{padding:10px 14px 14px 54px;border-bottom:1px solid var(--line);background:var(--surface);display:grid;gap:10px}
#jb-bridge-screen .extra textarea{width:100%;min-height:62px;resize:vertical;background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:8px 10px;font-size:13px}
#jb-bridge-screen .extra .meta{font-size:11.5px;color:var(--muted)}
#jb-bridge-screen .extra .payin{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;font-size:13px}
#jb-bridge-screen .extra .payin input{width:150px;text-align:right}
#jb-bridge-screen .hint{font-size:12.5px;color:var(--muted);max-width:92ch}
#jb-bridge-screen .mx{border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums;min-width:1060px;width:100%}
#jb-bridge-screen .mx th,
#jb-bridge-screen .mx td{padding:5px 9px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
#jb-bridge-screen .mx thead th{background:var(--hdr);color:#fff;font:500 10.5px/1.2 var(--font-mono);letter-spacing:.05em;text-transform:uppercase;position:sticky;top:0}
#jb-bridge-screen .mx td:first-child,
#jb-bridge-screen .mx th:first-child{text-align:left;position:sticky;left:0;background:var(--surface);z-index:1;min-width:230px;white-space:normal}
#jb-bridge-screen .mx thead th:first-child{background:var(--hdr)}
#jb-bridge-screen .mx tr.cat td{background:var(--oat);font-weight:600}
#jb-bridge-screen .mx tr.cat td:first-child{background:var(--oat)}
#jb-bridge-screen .mx tr.tot td{background:var(--total);font-weight:700}
#jb-bridge-screen .mx tr.tot td:first-child{background:var(--total)}
#jb-bridge-screen .mx td.out,
#jb-bridge-screen .mx th.out{opacity:.38}
#jb-bridge-screen .mx td.rng{font-weight:600;background:var(--total)}
#jb-bridge-screen .mx tr.off td{opacity:.45}
#jb-bridge-screen .chart{min-width:760px;width:100%;height:auto;display:block}
#jb-bridge-screen .chart text{font-family:var(--font-body);fill:var(--muted);font-size:11px}
#jb-bridge-screen .legend{display:flex;gap:16px;font-size:12px;color:var(--muted);margin:2px 2px 10px}
#jb-bridge-screen .legend i{display:inline-block;width:11px;height:11px;border-radius:2px;margin-right:6px;vertical-align:-1px}
#jb-bridge-screen .gl{border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums;min-width:1180px;width:100%}
#jb-bridge-screen .gl th,
#jb-bridge-screen .gl td{padding:5px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
#jb-bridge-screen .gl th{background:var(--hdr);color:#fff;font:500 10.5px/1.2 var(--font-mono);letter-spacing:.05em;text-transform:uppercase;position:sticky;top:0;white-space:nowrap}
#jb-bridge-screen .gl td.r,
#jb-bridge-screen .gl th.r{text-align:right}
#jb-bridge-screen .gl td:nth-child(2),
#jb-bridge-screen .gl td:nth-child(3),
#jb-bridge-screen .gl td:nth-child(4),
#jb-bridge-screen .gl td:nth-child(9),
#jb-bridge-screen .gl td.r{white-space:nowrap}
#jb-bridge-screen .gl td.cm{max-width:260px;color:var(--muted)}
#jb-bridge-screen .gl .mode{font:500 10px/1 var(--font-mono);letter-spacing:.04em;color:var(--muted);text-transform:uppercase}
#jb-bridge-screen .gl tr.hl td{background:var(--wash)}
#jb-bridge-screen .fbar{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin-bottom:10px}
#jb-bridge-screen .fbar input.inp{min-width:210px}
#jb-bridge-screen .sumline{font-size:13px;color:var(--muted);margin:0 0 10px}
#jb-bridge-screen .sumline b{color:var(--ink);font-variant-numeric:tabular-nums}
#jb-bridge-screen .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(380px,100%),1fr));gap:14px}
#jb-bridge-screen .card{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:14px 16px;min-width:0;overflow-x:auto}
#jb-bridge-screen .card h3{margin:0 0 4px;font:500 20px/1.2 var(--font-display)}
#jb-bridge-screen .card p{margin:6px 0;color:var(--muted);font-size:13px}
#jb-bridge-screen .card ul{margin:8px 0 0;padding-left:18px;font-size:13px;display:grid;gap:6px}
#jb-bridge-screen .t2{border-collapse:collapse;width:100%;font-size:12.5px;font-variant-numeric:tabular-nums;margin-top:8px}
#jb-bridge-screen .t2 th,
#jb-bridge-screen .t2 td{padding:5px 8px;border-bottom:1px solid var(--line);text-align:right}
#jb-bridge-screen .t2 th{font:500 10.5px/1.2 var(--font-mono);letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
#jb-bridge-screen .t2 th:first-child,
#jb-bridge-screen .t2 td:first-child{text-align:left}
#jb-bridge-screen .t2 td:not(:first-child){white-space:nowrap}
#jb-bridge-screen .t2 .okc{color:var(--green);font-weight:600}
#jb-bridge-screen .t2 .badc{color:var(--clay);font-weight:600}
#jb-bridge-screen .empty{padding:28px;text-align:center;color:var(--muted)}
#jb-bridge-screen h2.sec{font:500 22px/1.2 var(--font-display);margin:0 0 4px}
@media (max-width:1100px){
  #jb-bridge-screen .plgrid{grid-template-columns:minmax(0,1fr)}
  #jb-bridge-screen .rail{position:static;max-height:none}
}
@media (max-width:640px){
  #jb-bridge-screen .jbb-wrap-unused{padding-inline:16px}
  #jb-bridge-screen .tile .big{font-size:30px}
    #jb-bridge-screen .pl{min-width:0;font-size:11.5px}
  #jb-bridge-screen .pl th,
#jb-bridge-screen .pl td{padding:0 6px}
  #jb-bridge-screen .pl td.lbl{width:auto;white-space:normal;line-height:1.2;min-width:104px}
  #jb-bridge-screen .pl th:nth-child(5),
#jb-bridge-screen .pl td:nth-child(5){display:none}
  #jb-bridge-screen .pl thead th{font-size:11px}
  #jb-bridge-screen .mx td:first-child,
#jb-bridge-screen .mx th:first-child{min-width:150px}
}
@media (max-width:760px){
  #jb-bridge-screen .ledger{min-width:0}
  #jb-bridge-screen .lg{grid-template-columns:28px minmax(0,1fr) 92px;gap:6px 8px;padding:9px 10px}
  #jb-bridge-screen .lg.hd{display:none}
  #jb-bridge-screen .lg>:nth-child(3),
#jb-bridge-screen .lg>:nth-child(4),
#jb-bridge-screen .lg>:nth-child(5),
#jb-bridge-screen .lg>:nth-child(7){display:none}
  #jb-bridge-screen .lg>:nth-child(1){grid-column:1;grid-row:1}
  #jb-bridge-screen .lg>:nth-child(2){grid-column:2;grid-row:1}
  #jb-bridge-screen .lg>:nth-child(6){grid-column:3;grid-row:1;text-align:right}
  #jb-bridge-screen .lg>:nth-child(8){grid-column:2;grid-row:2}
  #jb-bridge-screen .lg>:nth-child(9){grid-column:3;grid-row:2;justify-self:end}
  #jb-bridge-screen .lg.cat>:nth-child(8),
#jb-bridge-screen .lg.cat>:nth-child(9),
#jb-bridge-screen .lg.end>:nth-child(8),
#jb-bridge-screen .lg.end>:nth-child(9){display:none}
  #jb-bridge-screen .extra{padding-left:14px}
}
@media (prefers-reduced-motion:reduce){
  #jb-bridge-screen *{scroll-behavior:auto!important;transition:none!important}
}
