:root {
  --bg: #f7f6f6; --panel: #ffffff; --ink: #1a1a1b; --muted: #6b6b70; --line: #e4e2e2;
  --red: #b81d14; --red-soft: #fdecea; --ok: #1a7f4b; --ok-soft: #e6f4ec; --warn: #9a6700; --warn-soft: #fff4d6;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0b0c; --panel: #151516; --ink: #efeeee; --muted: #9a9a9f; --line: #2a2a2c;
    --red: #f04237; --red-soft: #3a1512; --ok: #4cc58a; --ok-soft: #112a1d; --warn: #e3b341; --warn-soft: #2e2410;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif; }
.hidden { display: none !important; }
b { font-weight: 700; } em { font-style: normal; color: var(--red); font-weight: 600; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 800; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--muted); font: inherit; cursor: pointer; }
nav button:hover { background: var(--bg); color: var(--ink); }
nav button.on { background: var(--red-soft); color: var(--red); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
h1 { font-size: 22px; margin: 0 0 14px; } h2 { font-size: 16px; margin: 0 0 10px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.kpi .n { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.btn { font: inherit; padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label input, label select, label textarea { margin-top: 4px; color: var(--ink); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filters > * { width: auto; min-width: 130px; }
.filters input[type=search] { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--bg); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.tablewrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.err { color: var(--red); min-height: 1.3em; margin: 8px 0 0; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); }
.login-card .brand { margin-bottom: 16px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px; overflow-y: auto; z-index: 10; }
.drawer h2 { font-size: 19px; }
.drawer .row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.drawer .row span:first-child { color: var(--muted); }
.drawer .section { margin-top: 18px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 20; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.tpl { border-top: 1px solid var(--line); padding: 14px 0; }
.tpl:first-of-type { border-top: 0; }
.tpl .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
@media (max-width: 700px) { main { padding: 12px; } .top { padding: 10px 12px; } .hide-sm { display: none; } }

/* ---- redesign: Today page, claims, compact panel ---- */
main { max-width: 980px; }
.sub { color: var(--muted); margin: 0 0 16px; }
h2 { display: flex; align-items: center; gap: 8px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 680px) { .summary { grid-template-columns: 1fr; } }
.dec { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 14px 16px; cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow); }
.dec .big { font-size: 30px; font-weight: 700; line-height: 1; }
.dec .word { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.dec.act { border-color: var(--red); } .dec.act .word { color: var(--red); } .dec.watch .word { color: var(--warn); } .dec.ignore .word { color: var(--muted); }
.dec p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); text-transform: none; letter-spacing: 0; }
.tag.red { background: var(--red-soft); color: var(--red); } .tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.card.leaving { opacity: 0; transform: translateX(24px); transition: opacity .3s, transform .3s; }
.row1 { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.name { font-size: 19px; font-weight: 700; } .why { color: var(--muted); margin-top: 2px; } .why b { color: var(--ink); }
.phone { display: inline-block; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; padding: 11px 18px; border-radius: 12px; font-size: 18px; white-space: nowrap; }
.card .facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0 4px; font-size: 14px; }
.card .facts div span, .facts .kv span:first-child { display: block; color: var(--muted); font-size: 12px; }
.outcomes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.o { font: inherit; font-size: 15px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.o:hover { border-color: var(--muted); } .o:disabled { opacity: .5; } .o.good { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; } .o.bad { color: var(--red); }
.note { margin-top: 10px; } .note summary { cursor: pointer; color: var(--muted); font-size: 14px; } .note textarea { margin-top: 6px; }
.findrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; } .findrow input { width: 220px; }
.empty { color: var(--muted); padding: 14px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.done { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel); }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px 8px; border-radius: 8px; text-decoration: underline; }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; margin-left: 10px; }
.ok-text { color: var(--ok); }
table.dense th, table.dense td { padding: 8px 10px; }
.mini { width: 150px; } .mid { width: 230px; }
tr.done { opacity: .35; transition: opacity .6s; }
a { color: var(--red); }
.admin { display: grid; grid-template-columns: 180px 1fr; gap: 18px; } @media (max-width: 760px) { .admin { grid-template-columns: 1fr; } }
.side button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.side button.on, .side button:hover { background: var(--red-soft); color: var(--red); }

/* lead panel: pushes the page over instead of covering it; actions first, detail folded away */
.drawer { width: min(520px, 100%); }
@media (min-width: 1200px) { body.drawer-open main { margin-right: 540px; max-width: none; } }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.claimbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; margin: 12px 0; background: var(--bg); font-size: 14px; }
.claimbar.mine { background: var(--ok-soft); color: var(--ok); } .claimbar.theirs { background: var(--warn-soft); color: var(--warn); }
.drawer .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 4px 0 12px; }
.drawer .kv span:last-child { display: block; font-size: 14px; }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.panel h3 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .panel label { margin-bottom: 8px; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fold { border-top: 1px solid var(--line); padding: 10px 0; } .fold summary { cursor: pointer; font-weight: 600; }
.notes { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }

.fcp-logo { height: 36px; width: auto; margin-left: 6px; display: block; }
@media (max-width: 520px) { .fcp-logo { height: 28px; } }

/* ---- lead cards: badges + details like the DSCR pipeline row ---- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bd { font: 600 12px/1.2 "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.bd.flag { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.bd.cash { background: var(--ok-soft); color: var(--ok); border: 1px solid transparent; }
.bd.dash { background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--warn); }
.bd.chip { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ld { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ld-main { min-width: 0; flex: 1; }
.ld-name { font-size: 18px; font-weight: 700; cursor: pointer; } .ld-name:hover { text-decoration: underline; }
.ld-rec { font: 13px/1.5 "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--muted); margin-top: 4px; }
.ld-label { font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-top: 10px; }
.ld-fin { font-size: 15px; } .ld-prop { margin-top: 6px; font-size: 14px; }
.ld-side { text-align: right; flex-shrink: 0; }
.ld-ago { font-size: 17px; font-weight: 700; } .ld-cap { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.ld-loan { margin-top: 10px; font-size: 14px; }
@media (max-width: 560px) { .ld { flex-direction: column; } .ld-side { text-align: left; } }
.card.lead { padding: 16px 18px; }
.phone.sm { font-size: 15px; padding: 9px 14px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.segbtn { font: inherit; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.segbtn.on { background: var(--red-soft); color: var(--red); border-color: var(--red); font-weight: 600; }
.summary.two { grid-template-columns: repeat(2, 1fr); } @media (max-width: 680px) { .summary.two { grid-template-columns: 1fr; } }
.findrow input { width: 170px; }

/* ---- lead rows laid out like the DSCR pipeline's Leads tab ---- */
.dl { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; overflow: hidden; transition: opacity .3s, transform .3s; }
.dl.replied { border-left: 3px solid var(--ok); }
.dl.leaving { opacity: 0; transform: translateX(24px); }
.dl-row { display: grid; grid-template-columns: 1.5fr .75fr .8fr 2.1fr .95fr 128px; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.dl-row:hover { background: var(--bg); }
.dl-who .nm { font-weight: 700; font-size: 13.5px; }
.dl-who .ent { font: 11px/1.4 "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--muted); margin-top: 2px; }
.dl-cell .v { font-size: 13px; font-weight: 600; }
.dl-cell .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 1px; }
.more-pill { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font: 600 10px "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--ok); border: 1px solid var(--ok); vertical-align: 1px; }
.tg { display: inline-block; font: 700 10px/1.2 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: .05em; padding: 3px 7px; border-radius: 4px; margin: 0 4px 4px 0; border: 1px solid var(--line); color: var(--muted); }
.tg.hm { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.tg.cash { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tg.dash { background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--warn); }
.finprov { font: 10px/1.4 "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.dl-fin .k { margin-top: 4px; }
.dl-side { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.openbtn { font: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; padding: 5px 9px; color: var(--ink); cursor: pointer; }
.openbtn:hover { border-color: var(--muted); }
.callbtn { text-decoration: none; display: inline-block; }
.dl-detail { display: none; border-top: 1px dashed var(--line); padding: 14px 14px 16px; background: var(--bg); }
.dl.open .dl-detail { display: block; }
.dfacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 12px; font-size: 14px; }
.dfacts div span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) {
  .dl-row { grid-template-columns: 1fr auto; }
  .dl-cell { display: none; }
  .dl-cell.dl-fin { display: block; grid-column: 1 / -1; order: 3; }
  .dfacts { grid-template-columns: 1fr; }
}

/* ---- filter bar like the DSCR Leads tab ---- */
.fbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.fbar > * { width: auto; min-width: 130px; }
.fbar input[type=search] { flex: 1; min-width: 220px; }
.fbar.sub { font-size: 13px; }
.fbar .fnum { min-width: 90px; width: 100px; }
.fbar .fchk { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: var(--ink); white-space: nowrap; }
.fbar .fchk input { width: auto; min-width: 0; margin: 0; }

/* ---- All leads: left filter rail (same layout as the DSCR pipeline's Leads tab) ---- */
main:has(.rail) { max-width: none; padding: 0; }
.wrap { display: flex; min-height: calc(100vh - 60px); align-items: flex-start; }
.rail { width: 250px; flex-shrink: 0; border-right: 1px solid var(--line); padding: 16px 14px 70px; background: var(--panel); position: sticky; top: 56px; max-height: calc(100vh - 56px); overflow-y: auto; align-self: flex-start; }
.maincol { flex: 1; min-width: 0; padding: 18px 20px 60px; max-width: 1180px; }
.mainhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mainhead h1 { margin: 0; }
.mainhead select { width: auto; min-width: 190px; }
.rail .fgroup { margin-bottom: 18px; }
.rail .fgroup h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.rail select, .rail input[type=search] { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: 12.5px; padding: 5px 9px; margin: 0 4px 5px 0; cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--red-soft); border-color: var(--red); color: var(--red); font-weight: 600; }
.chip .dot, .rail .f .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.chip.preset { flex-direction: column; align-items: flex-start; gap: 1px; display: flex; width: 100%; text-align: left; }
.chip.preset .sets { font-size: 10.5px; font-weight: 400; opacity: .7; }
.rail .note { font-size: 11px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin: 6px 0 0; line-height: 1.45; }
.rail label.f { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; }
.rail label.f input { width: auto; margin: 0; }
.rangerow { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.rangerow input[type=number] { width: 72px; min-width: 0; }
.moresum { cursor: pointer; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.morecount { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 6px; }
.railbar { position: fixed; left: 0; bottom: 0; width: 250px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--line); box-sizing: border-box; z-index: 4; }
.railtoggle { display: none; }
@media (max-width: 860px) {
  .wrap { flex-direction: column; }
  .rail { width: 100%; position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .railbar { position: static; width: auto; padding: 8px 0 0; border: 0; }
  .railtoggle { display: block; width: 100%; margin-bottom: 8px; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
  .rail.collapsed > *:not(.railtoggle) { display: none; }
}
/* row tags: one colour per meaning, matching the filter chip dots */
.tg.pm { background: rgba(59,130,246,.12); color: #3b82f6; border-color: #3b82f6; }
.tg.st { background: var(--bg); color: var(--muted); border-color: var(--line); }
.tg.cash { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---- My leads > Pipeline board (Salesforce-style stage columns) ---- */
.pipesum { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.pipesum > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 150px; display: flex; flex-direction: column; }
.pipesum span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.pipesum b { font-size: 22px; } .pipesum em { font-size: 12px; color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.pcol { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-height: 160px; }
.pcol.over { outline: 2px dashed var(--red); }
.pc-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-top: 4px solid var(--line); border-radius: 10px 10px 0 0; background: var(--panel); }
.pc-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; cursor: grab; font-size: 13px; }
.pcard.drag { opacity: .4; }
.pc-nm { font-weight: 700; } .pc-sub { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.pc-row select { width: auto; max-width: 110px; font-size: 12px; padding: 2px 4px; }
main:has(.board) { max-width: 1500px; }
.pcard a.phone { display: inline; background: none; color: var(--red); padding: 0; border: 0; font-weight: 600; font-size: 13px; box-shadow: none; }
.pc-row select { max-width: 120px; }
.board { grid-template-columns: repeat(6, minmax(190px, 1fr)); }

.mywrap { display: grid; grid-template-columns: minmax(380px, 440px) 1fr; gap: 18px; align-items: start; }
.mywrap .queue h2, .mywrap .pipe h2 { margin-top: 0; }
.qh { font-size: 14px; margin: 16px 0 8px; }
.dueflag { color: var(--red); font-weight: 700; }
.fu { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; }
.fu select { width: auto; font-size: 12px; }
.pc-row select[data-fup] { max-width: 110px; }
.mywrap .board { grid-template-columns: repeat(5, minmax(170px, 1fr)); }
@media (max-width: 1100px) { .mywrap { grid-template-columns: 1fr; } }
main:has(.mywrap) { max-width: 1700px; }
/* queue column is narrow: keep who / loan / financing / call button, drop the portfolio and purchase-age cells (still in the drawer) */
.queue .dl-row > .dl-cell:nth-child(2), .queue .dl-row > .dl-cell:nth-child(5) { display: none; }
.queue .dl-row { flex-wrap: wrap; gap: 6px 10px; }
.queue .dl-fin { flex: 1 1 100%; order: 5; }

/* pipeline stage tiles + table (click a stage to see every lead in it) */
.stagetiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stile { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.stile .big { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stile:hover { border-color: var(--muted); }
.stile.on { background: var(--red-soft); border-color: var(--red); }
.stile.over { outline: 2px dashed var(--red); }
.ptable td { vertical-align: top; }
.ptable select { width: auto; max-width: 120px; font-size: 12px; padding: 2px 4px; display: block; margin-top: 3px; }
.prow.drag { opacity: .4; }
@media (max-width: 700px) { .stagetiles { grid-template-columns: repeat(3, 1fr); } }
.ptable a.phone { display: inline; background: none; color: var(--red); padding: 0; border: 0; box-shadow: none; font-weight: 600; font-size: 13px; }

.mailthread li { border-left: 3px solid var(--line); padding-left: 10px; margin-bottom: 10px; }
.mailthread li.in { border-left-color: var(--ok); } .mailthread li.out { border-left-color: var(--muted); }
.mailsub { font-weight: 600; margin-top: 2px; } .mailprev { color: var(--muted); white-space: pre-wrap; }

.who .iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.who .iconbtn:hover { color: var(--ink); border-color: var(--muted); }
.who #connectMail.connected { color: var(--ok); border-color: var(--ok); }
.mailprev-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--bg); }

.checks { list-style: none; padding: 0; margin: 10px 0; } .checks li { padding: 3px 0; } .checks li.ok { color: var(--ok); } .checks li.no { color: var(--muted); }

.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; position: sticky; top: 56px; z-index: 3; }
.bulkbar input[type=number] { width: 70px; }
.bulksep { flex: 1; }
.dl-sel { display: flex; align-items: center; padding: 0 6px 0 2px; }
.dl-sel input { width: 18px; height: 18px; margin: 0; cursor: pointer; }

/* My leads tables + full-page lead */
.scrollbox { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.scrollbox table { margin: 0; width: 100%; }
.scrollbox thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; box-shadow: 0 1px 0 var(--line); }
.clicktable tbody tr { cursor: pointer; } .clicktable tbody tr:hover { background: var(--bg); }
main:has(.workgrid) { max-width: 1250px; }
.workbar { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; } .workbar .spacer { flex: 1; }
.workhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; } .workhead h1 { margin: 0 0 2px; }
.workactions { display: flex; gap: 8px; align-items: center; }
.workgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; } .workgrid .col { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .workgrid { grid-template-columns: 1fr; } }

.stagetiles.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 0 12px; }
@media (max-width: 900px) { .stagetiles.seven { grid-template-columns: repeat(4, 1fr); } }

.contactline { margin-top: 6px; font-size: 15px; } .cline { white-space: nowrap; } .wrongn { text-decoration: line-through; color: var(--muted); }
.ptable td .cline + .cline { margin-top: 2px; }

main:has(.workgrid) { max-width: 1760px; }
main:has(.pipesum) { max-width: 1760px; }

.savestate { height: 18px; margin-top: 4px; font-size: 12px; color: var(--muted); } .savestate .fade { opacity: .65; transition: opacity 1s; }

.stagetiles.apt { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 14px; }
.stile.static { cursor: default; } .stile.static:hover { border-color: var(--line); }
@media (max-width: 700px) { .stagetiles.apt { grid-template-columns: repeat(2, 1fr); } }

main:has(.apt) { max-width: 1500px; }

.pipesum.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pipesum.big > div { min-width: 0; } .pipesum.big b small { font-size: 13px; font-weight: 600; color: var(--muted); }

.pipesum.big { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pipesum.big > div { padding: 10px 14px; } .pipesum.big span { font-size: 10.5px; }
@media (max-width: 1150px) { .pipesum.big { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pipesum.big { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.updatebar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; gap: 14px; align-items: center; justify-content: center; padding: 8px 12px; background: var(--red); color: #fff; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.updatebar button { background: #fff; color: var(--red); border: 0; border-radius: 6px; padding: 5px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.vertag { position: fixed; right: 10px; bottom: 6px; z-index: 5; font-size: 11px; color: var(--muted); opacity: .75; pointer-events: none; font-family: ui-monospace, Menlo, monospace; }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; } th.sortable:hover { color: var(--ink); }
