/* ============================================================================
   STORM OS · SCREEN LAYER
   Bindings and screen-level structures on top of the verbatim component
   library. Everything here either aliases view vocabulary onto guide styles
   or adds compositions the guide implies (KPI tiles, board internals, role
   blocks at Scale 2, report bars). No new colors, no new radii, no new
   timing — only the tokens.
   ========================================================================== */

#app{min-height:100dvh;display:flex;flex-direction:column}
.grow{flex:1;min-width:0}
.desk-only{display:none}
@media(min-width:1024px){.desk-only{display:flex}}
.pill-host:focus-visible{outline:var(--tk-focus-ring);outline-offset:2px;border-radius:var(--r-pill)}

/* ---------------------------------------------------------- motion colors
   sales reads as the Customer motion. These never re-map with the theme. */
.m-sales,.m-customer{--mo:var(--sos-motion-customer);--mo-soft:var(--sos-color-fill-soft)}
.m-investor{--mo:var(--sos-motion-investor);--mo-soft:var(--sos-color-fill-info)}
.m-partner{--mo:var(--sos-motion-partner);--mo-soft:var(--sos-color-fill-partner)}
i.m-sales,i.m-customer{background:var(--sos-motion-customer)}
i.m-investor{background:var(--sos-motion-investor)}
i.m-partner{background:var(--sos-motion-partner)}
.rot{color:var(--sos-color-warning)!important;font-weight:600}
.big{font-size:22px;font-weight:600;color:var(--sos-color-anchor);letter-spacing:-.01em;line-height:1.1}
.big2{font-size:16px;font-weight:600;color:var(--sos-color-anchor);line-height:1.2}
.nm.clamp{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ------------------------------------------------------------------- home */
.home-hi{margin:var(--s-2) 0 var(--s-5)}
.home-hi h2{font-size:26px;letter-spacing:0;line-height:1.15}
.home-hi p{margin-top:3px}
.kpi{text-align:left;cursor:pointer;transition:border-color var(--t-fast) var(--ease-out),box-shadow var(--t-fast) var(--ease-out)}
.kpi:hover{border-color:var(--sos-slate-300)}
.kpi .top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kpi .top svg{width:16px;height:16px;color:var(--sos-slate-300);flex:none}
.kpi .lb{font-size:11.5px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;
  color:var(--sos-color-text-muted)}
.kpi .val{font-family:var(--sos-font-mono);font-size:24px;font-weight:600;color:var(--sos-color-anchor);
  line-height:1.1;margin-top:7px;font-variant-numeric:tabular-nums;letter-spacing:-.02em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(min-width:768px){.kpi .val{font-size:27px}}
.kpi .val.warn{color:var(--sos-color-warning)}
.kpi .bar{margin-top:9px}
.kpi .asof{margin-top:6px}

.pipes-grid{display:grid;gap:10px}
@media(min-width:768px){.pipes-grid{grid-template-columns:repeat(3,1fr);gap:var(--s-4)}}
.pipe-card{text-align:left;cursor:pointer;padding:var(--s-4) var(--s-5);display:block;width:100%}
.pipe-card:hover{border-color:var(--sos-slate-300)}
.pipe-card .hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:10px}
.pipe-card .hd .nm{font-size:14.5px;font-weight:700;color:var(--sos-color-anchor)}
.pipe-card .hd .ct{font-family:var(--sos-font-mono);font-size:11px;color:var(--sos-color-text-muted)}
.pipe-card .strip{display:flex;align-items:flex-end;gap:4px;height:32px;margin-bottom:10px}
.pipe-card .strip i{flex:1;border-radius:3px 3px 0 0;min-height:6px}
.pipe-card .ft{display:flex;align-items:baseline;gap:10px}
.pipe-card .tot{font-size:15px;font-weight:600;color:var(--sos-color-anchor)}

.ckl-head{display:flex;align-items:center;gap:12px;padding:var(--s-4) var(--s-5);
  border-bottom:1px solid var(--sos-slate-100)}

/* -------------------------------------------------------------- row extras */
.rowitem{cursor:pointer}
.rowitem .sb{font-size:12.5px;color:var(--sos-color-text-muted);margin-top:2px;display:block;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rowitem .nm{display:block}
.rowitem .amt{font-family:var(--sos-font-mono);font-size:13px;font-weight:600;color:var(--sos-color-anchor);
  font-variant-numeric:tabular-nums;flex:none}
.rowitem.now{background:var(--tk-primary-soft)}
.rowitem.now .nm{color:var(--tk-primary)}
.rowitem .lead-ic.amber{background:var(--sos-risk-50);color:var(--sos-color-warning)}
.rowitem .lead-ic.red{background:var(--sos-lost-50);color:var(--sos-color-danger)}
.rowitem .lead-ic.m-sales,.rowitem .lead-ic.m-customer{background:var(--sos-color-fill-soft);color:var(--sos-motion-customer)}
.rowitem .lead-ic.m-investor{background:var(--sos-color-fill-info);color:var(--sos-motion-investor)}
.rowitem .lead-ic.m-partner{background:var(--sos-color-fill-partner);color:var(--sos-motion-partner)}
.rowitem.unread{background:var(--sos-color-fill-info)}
.rowitem.unread:hover{background:#DDF0FB}
.rowitem .nm b{color:inherit;font-weight:700}

.due{font-family:var(--sos-font-mono);font-size:11.5px;color:var(--sos-color-text-muted);
  white-space:nowrap;flex:none;font-variant-numeric:tabular-nums}
.due.late{color:var(--sos-color-danger);font-weight:600}
.ckbox{width:22px;height:22px;border-radius:50%;border:1.5px solid var(--sos-slate-300);flex:none;
  display:flex;align-items:center;justify-content:center;color:transparent;
  transition:all var(--t-fast) var(--ease-out)}
.ckbox:hover{border-color:var(--sos-color-success)}
.ckbox.done{background:var(--sos-color-success);border-color:var(--sos-color-success);color:#fff}
.ckbox svg{width:12px;height:12px}
.ct-badge{font-family:var(--sos-font-mono);font-size:11px;background:var(--sos-slate-100);
  color:var(--sos-color-text-muted);padding:2px 8px;border-radius:var(--r-pill);flex:none}

/* -------------------------------------------------------------- board bits */
.board-tools{display:flex;align-items:center;gap:10px;margin-bottom:var(--s-4);flex-wrap:wrap}
/* the chips take a full line before they'll be squeezed into a spill */
.board-tools .filters{margin-bottom:0;flex:1 1 100%;min-width:0}
@media(min-width:700px){.board-tools .filters{flex:1 1 auto}}
.board-tools .sp{flex:1}
.seg-sm{padding:2px;gap:2px}
.seg-sm button{padding:5px 12px;min-height:30px;font-size:12.5px}

.kb-hd{display:flex;align-items:baseline;gap:8px;padding:2px 4px 6px}
.kb-hd .nm{font-size:12.5px;font-weight:600;color:var(--sos-color-anchor)}
.kb-hd .ct{font-family:var(--sos-font-mono);font-size:11px;color:var(--sos-color-text-muted)}
.kb-hd .tt{font-family:var(--sos-font-mono);font-size:11px;color:var(--sos-slate-700);
  font-variant-numeric:tabular-nums;white-space:nowrap}
.kb-hd .pr{font-family:var(--sos-font-mono)}
.kb-sub{font-family:var(--sos-font-mono);font-size:10.5px;padding:0 4px 8px;
  border-bottom:1px solid var(--sos-color-border);margin-bottom:9px;color:var(--sos-color-text-muted)}
.kb-col:not(:has(.kb-sub)) .kb-cards{border-top:1px solid var(--sos-color-border);padding-top:9px;margin-top:2px}


.kb-card .t{display:flex;align-items:flex-start;gap:6px;margin-bottom:6px}
.kb-card .t .nm{flex:1;min-width:0;font-size:13.5px;font-weight:600;color:var(--sos-color-anchor);line-height:1.35}
.kb-card .mv{width:26px;height:26px;margin:-4px -6px 0 0;border-radius:var(--r-xs);flex:none;
  display:flex;align-items:center;justify-content:center;color:var(--sos-slate-400)}
.kb-card .mv:hover{background:var(--sos-slate-100);color:var(--sos-slate-700)}
.kb-card .mv svg{width:15px;height:15px}
.kb-card .m{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kb-card .m .amt,.kb-card .m .pr{font-family:var(--sos-font-mono);font-size:13.5px;font-weight:600;
  color:var(--sos-color-anchor);font-variant-numeric:tabular-nums}
.kb-card .days{font-family:var(--sos-font-mono);font-size:10.5px;color:var(--sos-color-text-muted);
  white-space:nowrap;display:inline-flex;align-items:center;gap:3px}
.kb-card .days svg{width:11px;height:11px}
.kb-card .days.rot{color:var(--sos-color-warning);font-weight:600}
.kb-card .nx{display:flex;align-items:center;gap:5px;margin-top:8px;font-size:11.5px;
  color:var(--sos-slate-700);overflow:hidden}
.kb-card .nx svg{width:12px;height:12px;flex:none;color:var(--sos-slate-400)}
.kb-card .nx span,.kb-card .nx{text-overflow:ellipsis;white-space:nowrap}
.kb-card .nx.miss{color:var(--sos-color-warning);font-weight:500}
.kb-card .nx.miss svg{color:var(--sos-color-warning)}
.kb-src{opacity:.35}
.kb-over{background:var(--tk-primary-soft)}
.kb-add{width:100%;border:1px dashed var(--sos-slate-300);border-radius:var(--r-6);
  padding:9px;font-size:13px;color:var(--sos-color-text-muted);display:flex;align-items:center;
  justify-content:center;gap:6px;background:none;transition:all var(--t-fast) var(--ease-out)}
.kb-add:hover{border-color:var(--tk-primary);color:var(--tk-primary);background:#fff}
.kb-add svg{width:14px;height:14px}

.kb-terminal{width:200px;display:flex;flex-direction:column;gap:10px}
@media(max-width:480px){.kb-terminal{width:64vw;max-width:200px}}
.kb-term{background:var(--sos-slate-50);border:1px dashed var(--sos-slate-300);
  border-radius:var(--tk-radius);padding:10px 12px;transition:background var(--t-fast) var(--ease-out)}
.kb-term .hd{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:4px}
.kb-term .hd .nm{font-size:12.5px;font-weight:600}
.kb-term.won .hd .nm{color:var(--sos-color-success)}
.kb-term.lost .hd .nm{color:var(--sos-color-danger)}
.kb-term .hd .ct{font-family:var(--sos-font-mono);font-size:11px;color:var(--sos-color-text-muted)}
.kb-term .tt{font-family:var(--sos-font-mono);font-size:11px;color:var(--sos-slate-700);margin-bottom:6px}
.kb-term.kb-over{background:var(--tk-primary-soft);border-style:solid}
.kb-mini{display:block;width:100%;text-align:left;font-size:12px;color:var(--sos-slate-700);
  padding:6px 8px;border-radius:var(--r-xs);background:#fff;border:1px solid var(--sos-slate-200);
  margin-bottom:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kb-mini:hover{border-color:var(--sos-slate-300)}

/* ------------------------------------------------------------- record page */
.rec-head{display:flex;align-items:center;gap:14px}
.rec-head .bk{width:38px;height:38px;border-radius:var(--r-6);flex:none;display:flex;
  align-items:center;justify-content:center;color:var(--sos-slate-500);margin-left:-6px;
  transition:background var(--t-fast) var(--ease-out)}
.rec-head .bk:hover{background:var(--sos-slate-100);color:var(--sos-color-anchor)}
.rec-head .bk svg{width:19px;height:19px}
.rec-head h2{font-size:20px;letter-spacing:0;line-height:1.2;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.rec-head .sb{font-size:13.5px;color:var(--sos-color-text-muted);margin-top:2px}
.rec-head .sb a{font-weight:500}

.roleblocks{display:grid;gap:10px;margin-bottom:var(--s-4)}
@media(min-width:768px){.roleblocks{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}}
.role-block .hd{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.role-block .hd .sub{font-size:12.5px;font-weight:600;color:var(--sos-slate-700)}
.role-block .since{font-family:var(--sos-font-mono);font-size:10.5px;color:var(--sos-slate-400)}
.role-block .eng .kicker{margin-bottom:7px}
.role-block .scores{margin-top:13px;padding-top:12px;border-top:1px solid var(--sos-slate-100)}
.scorerow .lb{font-size:12.5px;color:var(--sos-color-text-muted);width:64px;flex:none}

.addrole{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:var(--s-5)}

.tabs{margin-bottom:var(--s-4)}
.tabs button .n{font-family:var(--sos-font-mono);font-size:11px;background:var(--sos-slate-100);
  color:var(--sos-color-text-muted);padding:1px 6px;border-radius:var(--r-pill)}
.tabs button.on .n{background:var(--tk-primary-soft);color:var(--tk-primary)}

.dl{padding:2px 0}
.opp-nums{display:grid;grid-template-columns:repeat(3,auto);gap:var(--s-5);justify-content:start;
  margin-bottom:var(--s-4)}
.opp-nums .kicker{margin-bottom:3px}
.stage-track{display:flex;gap:4px;margin-bottom:var(--s-4)}
.stage-track i{flex:1;height:5px;border-radius:3px;background:var(--sos-slate-200)}
.stage-track i.on{background:var(--mo,var(--sos-motion-customer))}

/* --------------------------------------------------------------- timeline */
.tl-ev{position:relative;padding:0 0 var(--s-5)}
.tl-ev:last-child{padding-bottom:var(--s-2)}
.tl-ev .nd{position:absolute;left:-19px;top:5px;width:10px;height:10px;border-radius:50%;
  background:#fff;border:2px solid var(--sos-slate-300)}
.tl-ev .nd.stage{border-color:var(--tk-primary)}
.tl-ev .nd.note{border-color:var(--sos-color-accent)}
.tl-ev .nd.role{border-color:var(--sos-motion-partner)}
.tl-ev .tx{font-size:13.5px;color:var(--sos-slate-700);line-height:1.5}
.tl-ev .mt{font-family:var(--sos-font-mono);font-size:11px;color:var(--sos-slate-400);margin-top:3px}

/* ----------------------------------------------------------------- search */
.search-inp{min-height:50px;font-size:16px;border-radius:var(--r-14)}

/* ---------------------------------------------------------------- reports */
.cb{background:none;border:none;padding:0;width:100%;cursor:pointer;text-align:left}
.cb .lb{color:var(--sos-slate-700);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px}
.cb .bar{height:20px;background:var(--sos-slate-100);border-radius:var(--r-xs);overflow:hidden}
.cb .bar i{display:block;height:100%;border-radius:var(--r-xs);min-width:2px;
  transition:width var(--t-slow) var(--ease-out)}
.cb:hover .lb{color:var(--sos-color-anchor)}
.rep-foot{display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  margin-top:var(--s-4);padding-top:var(--s-4);border-top:1px solid var(--sos-slate-100)}
.raise-line{display:flex;align-items:baseline;gap:9px;margin-bottom:9px;flex-wrap:wrap}
.bar.tall{height:12px}

.dash-grid{display:grid;gap:10px}
@media(min-width:768px){.dash-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:var(--s-4)}}
.dash-card{text-align:left;cursor:pointer;display:block;width:100%}
.dash-card:hover{border-color:var(--sos-slate-300)}
.dash-card .hd{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.dash-card .hd .nm{font-size:15px;font-weight:700;color:var(--sos-color-anchor)}
.dash-card .nums{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.dash-card .nums .v{font-size:17px;font-weight:600;color:var(--sos-color-anchor);
  font-variant-numeric:tabular-nums;margin-top:2px}
.dash-card .asof{margin-top:10px}

/* small polish */
.card>.rowlist,.card.rowlist{overflow:hidden;border-radius:inherit}
.empty.slim{padding:var(--s-6) var(--s-5)}
.empty.slim h3{font-size:16px}

/* ============================================================================
   v1.1 · OPPORTUNITIES, FUNNEL EDITOR, DASHBOARDS, MODERN POLISH
   ========================================================================== */

/* ---- motion variable plumbing: any element tagged m-* exposes --mo */
.m-sales, .m-customer { --mo: var(--sos-motion-customer); --mo-ink: var(--sos-motion-customer-ink); }
.m-investor { --mo: var(--sos-motion-investor); --mo-ink: var(--sos-motion-investor-ink); }
.m-partner { --mo: var(--sos-motion-partner); --mo-ink: var(--sos-motion-partner-ink); }

/* ---- modern lift: cards that act like buttons rise to meet the pointer */
.lift { transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out); }
@media (hover:hover) {
  .lift:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
}
.overlay { backdrop-filter: blur(3px); }

/* small icon button used across the new surfaces */
.ib-lite {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--sos-slate-200);
  background: #fff; color: var(--sos-slate-700); cursor: pointer; flex: 0 0 auto;
  transition: background .12s, border-color .12s;
}
.ib-lite:hover { background: var(--sos-slate-50); border-color: var(--sos-slate-300); }
.ib-lite.sm { width: 30px; height: 30px; border-radius: 8px; }
.ib-lite .ic { width: 17px; height: 17px; }
.lead-ic.red { color: var(--sos-lost-700); background: var(--sos-lost-50); }

/* =============================================== opportunity stage stepper */
.stepper-wrap { overflow: hidden; }
.stepper {
  display: flex; gap: 3px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.stp {
  --bg: color-mix(in srgb, var(--mo) var(--depth, 40%), #fff);
  position: relative; flex: 1 0 auto; min-width: 96px; border: 0; cursor: pointer;
  padding: 9px 12px 9px 20px; text-align: left; color: var(--sos-ink-900); background: var(--bg);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  transition: filter .12s;
  display: flex; flex-direction: column; gap: 1px; justify-content: center;
}
.stp:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; border-radius: 8px 0 0 8px; }
.stp.terminal { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); border-radius: 0 8px 8px 0; flex: 0 0 auto; min-width: 74px; }
.stp .stp-n {
  font: 600 10.5px/1 var(--sos-font-mono); opacity: .72; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 3px;
}
.stp .stp-n .ic { width: 13px; height: 13px; }
.stp .stp-l { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 15ch; }
.stp.todo { background: var(--sos-ink-100); color: var(--sos-ink-600); }
.stp.todo .stp-n { opacity: .7; }
.stp.done { background: var(--bg); color: var(--sos-ink-900); }
.stp.now { background: var(--mo); color: #fff; }
.stp.now .stp-n { opacity: .92; }
.stp.now .stp-l { font-weight: 700; }
.stp.won.now { background: var(--sos-signal-600); }
.stp.lost.now { background: var(--sos-lost-600); }
@media (hover:hover) { .stp:not(.now):not(:disabled):hover { filter: brightness(.96); } }
.stepper-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* header band tint on the opportunity detail */
.opp-head { position: relative; overflow: hidden; }
.opp-head::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mo) 35%, #fff), var(--mo));
}

.opp-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px 18px; }
.opp-nums .big2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.opp-nums .rot { color: var(--sos-risk-600); }
.prob-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  font: inherit; cursor: pointer; padding: 0; color: inherit;
}
.prob-btn:disabled { cursor: default; }
.prob-btn .ic { width: 14px; height: 14px; color: var(--sos-slate-400); }
.prob-btn .ovr { font-size: 10px; }
.range { width: 100%; accent-color: var(--tk-primary); }

/* partner agreement checklist */
.agree { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-step {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-radius: 999px; border: 1.5px solid var(--sos-slate-200); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--sos-slate-500); cursor: pointer;
  transition: all .14s;
}
.ag-step .ck {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--sos-slate-300);
  display: inline-flex; align-items: center; justify-content: center; background: #fff;
}
.ag-step .ck .ic { width: 11px; height: 11px; }
.ag-step.on { border-color: var(--sos-motion-partner); color: var(--sos-motion-partner); background: color-mix(in srgb, var(--sos-motion-partner) 6%, #fff); }
.ag-step.on .ck { background: var(--sos-motion-partner); border-color: var(--sos-motion-partner); color: #fff; }

/* -------------------------------------------------- opportunities listing */
.sort-sel { width: auto; min-width: 0; padding: 7px 30px 7px 10px; font-size: 13px; }
.opp-row { cursor: pointer; }
.bulkbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  background: var(--sos-ink-900); color: #fff; border-radius: 14px;
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--sh-over); z-index: 40;
  animation: bulkin .18s var(--ease-out);
}
@keyframes bulkin { from { transform: translateY(8px); opacity: 0; } }
.bulkbar .bb { background: rgba(255,255,255,.12); color: #fff; border: 0; }
.bulkbar .bb:hover { background: rgba(255,255,255,.2); }
.bulkbar .bb:disabled { opacity: .4; }
.bulkbar .bb.ghost { background: transparent; }
@media (min-width: 900px) { .bulkbar { left: auto; right: 28px; bottom: 24px; min-width: 420px; } }

/* --------------------------------------------------- kanban stage accents */
.kb-col { position: relative; }
.kb-accent {
  height: 3px; border-radius: 2px 2px 0 0; margin-bottom: 8px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--mo) calc(var(--depth, 50%) * .55), var(--sos-slate-200)),
    color-mix(in srgb, var(--mo) var(--depth, 50%), #fff));
}
.kb-idx {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--mo) 16%, #fff);
  color: var(--mo-ink);
}
.kb-col:not(.kb-terminal):not(:last-child)::after {
  content: ''; position: absolute; top: 42%; right: -13px; width: 8px; height: 8px;
  border-top: 2px solid var(--sos-slate-300); border-right: 2px solid var(--sos-slate-300);
  transform: rotate(45deg); pointer-events: none;
}

/* ------------------------------------------------------ association rows */
.assoc { align-items: center; }
.assoc-go { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: none; cursor: pointer; padding: 0; min-width: 0; font: inherit; color: inherit; }
.chip-primary { gap: 4px; color: var(--sos-brand-700); background: var(--sos-brand-50); border-color: var(--sos-brand-200); margin-left: 8px; vertical-align: 2px; }
.chip-primary .ic { width: 11px; height: 11px; }
.rowitem.indent { padding-left: 34px; }
.rowitem.now { background: var(--tk-primary-soft); }

/* ------------------------------------------------------------ funnels admin */
.mdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mo); margin-right: 8px; vertical-align: 1px; }
.fun-card.inactive { opacity: .62; }
.fun-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fun-name {
  font: 700 16.5px/1.2 var(--tk-font-head); color: var(--sos-color-anchor);
  border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; margin-left: -8px;
  background: transparent; min-width: 0; width: min(300px, 55%);
}
.fun-name:hover { border-color: var(--sos-slate-200); }
.fun-name:focus-visible { border-color: var(--tk-primary); outline: none; background: #fff; }
.funnel { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.funnel::-webkit-scrollbar { display: none; }
.fseg {
  --bg: color-mix(in srgb, var(--mo) var(--depth, 40%), #fff);
  position: relative; flex: 1 0 auto; min-width: 86px; border: 0; cursor: pointer;
  background: var(--bg); color: var(--sos-ink-900); text-align: left;
  padding: 12px 12px 12px 20px;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%);
  display: flex; flex-direction: column; gap: 3px; transition: filter .12s;
}
.fseg:first-child { clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); border-radius: 9px 0 0 9px; padding-left: 13px; }
.fseg.fterm { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 11px 50%); border-radius: 0 9px 9px 0; background: var(--sos-ink-100); color: var(--sos-ink-600); flex: 0 0 auto; min-width: 78px; cursor: default; }
.fseg .fs-n { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14ch; }
.fseg .fs-m { font-size: 10.5px; color: var(--mo-ink); font-weight: 600; }
.fseg .fs-m .ic { width: 13px; height: 13px; }
.fseg .fs-ct {
  position: absolute; top: 6px; right: 15px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--sos-white); color: var(--mo-ink);
  font: 700 10.5px/17px var(--sos-font-mono); text-align: center;
  box-shadow: var(--sh-rest);
}
.fseg .fs-req { position: absolute; bottom: 5px; right: 15px; color: var(--mo-ink); opacity: .8; }
.fseg .fs-req .ic { width: 11px; height: 11px; }
@media (hover:hover) { .fseg:not(.fterm):hover { filter: brightness(.94); } }
.fun-ft { display: flex; gap: 8px; margin-top: 12px; }

/* member axes */
.axes { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.role-pill { font-weight: 700; }
.utype { color: var(--sos-slate-500); }
.chip-invited { color: var(--sos-risk-700); background: var(--sos-risk-50); border-color: var(--sos-risk-100); }
.role-hint { margin-top: 6px; color: var(--sos-slate-500); }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 480px) { .form-2col { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- dashboards */
.dash-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.dash-card { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--sos-slate-200); }
.dash-card h3 { margin: 0; }
.mini-funnel { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.mini-funnel i {
  flex: 1; border-radius: 3px 3px 0 0;
  background: color-mix(in srgb, var(--mo) var(--depth, 50%), #fff);
}
.dbgrid { display: grid; gap: 14px; }
@media (min-width: 860px) { .dbgrid { grid-template-columns: 1fr 1fr; } .dbgrid .w-wide { grid-column: 1 / -1; } }
.widget .wg-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.widget .pad-h { padding: 14px 16px 0; }
.widget .pad-h .wg-hd { margin-bottom: 6px; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.kpi-cell { text-align: center; padding: 10px 6px; border-radius: 10px; background: var(--sos-slate-50); }
.kpi-cell .v { font-size: 21px; font-weight: 700; }
.kpi-cell .l { font-size: 11px; color: var(--sos-slate-500); margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; }
.kpi-cell.up .v { color: var(--sos-signal-600); }
.kpi-cell.down .v { color: var(--sos-risk-600); }
.kpi-cell.warn .v { color: var(--sos-risk-700); }

.wfunnel { display: flex; flex-direction: column; gap: 6px; }
.wfunnel.slim { gap: 4px; }
.wf-row { display: grid; grid-template-columns: minmax(84px, 130px) 1fr auto; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; }
div.wf-row { cursor: default; }
.wf-l { font-size: 12.5px; color: var(--sos-slate-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-bar { height: 16px; background: var(--sos-slate-100); border-radius: 5px; overflow: hidden; }
.wf-bar i { display: block; height: 100%; border-radius: 5px; background: color-mix(in srgb, var(--mo, var(--tk-primary)) var(--depth, 60%), #fff); transition: width .3s var(--ease-out); }
.wf-v { font-size: 12.5px; min-width: 30px; text-align: right; }

.rfunnel { display: flex; flex-direction: column; gap: 6px; }
.rfunnel .wf-bar i { background: color-mix(in srgb, var(--tk-primary) var(--depth, 60%), #fff); }

.kpi-single { text-align: center; padding: 14px 0 8px; }
.kpi-single .v { font-size: 34px; font-weight: 700; }
.kpi-single .l { font-size: 12px; color: var(--sos-slate-500); margin-top: 4px; }

.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 120px; height: 120px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.donut .hole {
  position: absolute; inset: 22px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.legend { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1; }
.legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.rtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.rtable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--sos-slate-500); padding: 6px 8px; border-bottom: 1px solid var(--sos-slate-200); }
.rtable td { padding: 8px; border-bottom: 1px solid var(--sos-slate-100); }
.rtable .r { text-align: right; }

.report-card h3 { font-size: 15.5px; }

/* grid/flex items must be allowed to shrink so the ladder scrolls internally */
.roleblocks > * , .role-block .eng { min-width: 0; }
.role-block { max-width: 100%; }

/* ============================================================================
   FUNNEL VIEW (ADR-15) — stages down the page, cards into the width.
   ========================================================================== */
.fnl { display: flex; flex-direction: column; gap: 10px; }
.fnl-st { background: var(--sos-white); border: 1px solid var(--sos-ink-200);
  border-radius: var(--tk-radius); box-shadow: var(--sh-card); overflow: hidden; }
.fnl-hd {
  position: relative; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto 16px;
  align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; cursor: pointer;
  background: none; text-align: left; font: inherit; color: inherit;
}
/* the row's own fill is the measure — every stage shares the full width as its
   scale, so the stack reads as a funnel instead of five unrelated bars */
.fnl-hd::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: var(--share, 0%);
  background: color-mix(in srgb, var(--mo) 13%, transparent); pointer-events: none;
  transition: width .35s var(--ease-out);
}
.fnl-hd > * { position: relative; }
.fnl-hd:hover { background: var(--sos-ink-50); }
.fnl-ix {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--mo) 16%, #fff); color: var(--mo-ink);
}
.fnl-nm { font-weight: 600; color: var(--sos-ink-900); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fnl-ct { font-size: 13px; font-weight: 700; color: var(--sos-ink-700); min-width: 18px; text-align: right; }
.fnl-amt { font-size: 12.5px; color: var(--sos-ink-500); min-width: 46px; text-align: right; }
.fnl-amt.mute { color: var(--sos-ink-400); }
.fnl-cv { color: var(--sos-ink-400); width: 16px; height: 16px; }
.fnl-cards { display: grid; gap: 8px; padding: 0 12px 12px; }
@media (min-width: 700px) { .fnl-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .fnl-cards { grid-template-columns: repeat(3, 1fr); } }
.fnl-empty {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 14px; border: 1px dashed var(--sos-ink-200); border-radius: var(--r-10);
  background: none; color: var(--sos-ink-500); font: inherit; font-size: 13px; cursor: pointer;
}
.fnl-empty:hover { border-color: var(--tk-primary); color: var(--tk-primary); background: var(--sos-brand-50); }
.fnl-term { display: flex; gap: 10px; flex-wrap: wrap; }
.fnl-tm {
  flex: 1 1 160px; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: var(--tk-radius); border: 1px solid var(--sos-ink-200); background: var(--sos-white);
  text-decoration: none; color: var(--sos-ink-600); box-shadow: var(--sh-rest);
}
.fnl-tm:hover { text-decoration: none; border-color: var(--sos-ink-300); }
.fnl-tm .nm { font-weight: 600; color: var(--sos-ink-700); font-size: 13.5px; }
.fnl-tm .ct { margin-left: auto; font-weight: 700; }
.fnl-tm.won .ct { color: var(--sos-signal-700); }
.fnl-tm.lost .ct { color: var(--sos-ink-500); }

/* card: the org line the stripe used to stand in for */
.kb-card .t { display: flex; align-items: center; gap: 8px; }
.kb-card .og { font-size: 12px; color: var(--sos-ink-500); margin: 2px 0 0 21px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card .t .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card .t .mv { margin-left: auto; }

/* ------------------------------------------------------------ data & fields */
.ftype {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sos-ink-500); background: var(--sos-ink-100); border-radius: var(--r-xs);
  padding: 4px 7px; min-width: 62px; text-align: center;
}
.ftype.sm { min-width: 0; font-size: 9.5px; padding: 2px 5px; }
.built summary { cursor: pointer; font-size: 13px; color: var(--sos-ink-500); padding: 4px 0; }
.built summary::marker { color: var(--sos-ink-400); }
.built-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 0; }
.built-f {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sos-ink-600);
  border: 1px solid var(--sos-ink-200); border-radius: var(--r-6); padding: 4px 8px; background: var(--sos-white);
}
.optlist { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.opt-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500;
  background: var(--sos-brand-50); color: var(--sos-brand-700); border: 1px solid var(--sos-brand-200);
  border-radius: var(--r-pill); padding: 4px 6px 4px 11px;
}
.opt-tag button { border: 0; background: none; cursor: pointer; color: inherit; display: flex; padding: 2px; border-radius: 50%; }
.opt-tag button:hover { background: var(--sos-brand-100); }
.opt-tag .ic { width: 12px; height: 12px; }
.fld-div {
  font-size: 11px; font-weight: 700; letter-spacing: var(--sos-track-kicker); text-transform: uppercase;
  color: var(--sos-ink-400); border-top: 1px solid var(--sos-ink-200);
  margin: 18px 0 14px; padding-top: 14px;
}
.help.err { color: var(--sos-lost-700); background: var(--sos-lost-50); border: 1px solid var(--sos-lost-100);
  border-radius: var(--r-6); padding: 8px 10px; font-size: 13px; margin-top: 10px; }

/* health, consistently: strength where it varies, words next to it */
.mdot.sm { width: 7px; height: 7px; margin-right: 6px; }
.hbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-6);
  margin-bottom: 14px; background: var(--sos-ink-50); border: 1px solid var(--sos-ink-200); }
.hbar.h-attention { background: var(--sos-risk-50); border-color: var(--sos-risk-100); }
.hbar.h-late { background: var(--sos-lost-50); border-color: var(--sos-lost-100); }
.hbar .sig-l { font-weight: 600; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* ---- funnel: cards get a tray of their own, and room to breathe ---------- */
.fnl-cards {
  padding: 12px; gap: 10px;
  background: var(--sos-ink-50);
  border-top: 1px solid var(--sos-ink-200);
}
.fnl-cards .kb-card { margin-bottom: 0; box-shadow: var(--sh-card); }
.fnl-cards .kb-card:hover { border-color: var(--sos-ink-300); box-shadow: var(--sh-lift); }
.fnl-st.kb-over { border-color: var(--tk-primary); box-shadow: 0 0 0 3px var(--tk-primary-soft); }
.fnl-st.kb-over .fnl-cards { background: var(--tk-primary-soft); }
.fnl-tm.kb-over { border-color: var(--tk-primary); box-shadow: 0 0 0 3px var(--tk-primary-soft); }

/* the grip: quiet on a mouse, always there for a finger */
.kb-grip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 20px; margin: -2px -2px -2px -4px; flex: none;
  color: var(--sos-ink-300); cursor: grab; touch-action: none;
}
.kb-grip .ic { width: 15px; height: 15px; }
.kb-grip:active { cursor: grabbing; }
@media (hover: hover) { .kb-card .kb-grip { opacity: .45; transition: opacity .12s; } .kb-card:hover .kb-grip { opacity: 1; } }
body.is-dragging { cursor: grabbing; user-select: none; }
body.is-dragging .kb-card { cursor: grabbing; }

/* ------------------------------------------------- classic funnel + gauge */
.cfun-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cfun { width: 100%; max-width: 340px; height: auto; overflow: visible; }
.cfun .cf-l { font: 600 11px var(--sos-font-body); fill: var(--sos-ink-900); }
.cfun .cf-v { font: 700 12px var(--sos-font-mono); fill: var(--sos-ink-900); }
.cfun .cf-c { font: 600 9px var(--sos-font-mono); fill: var(--sos-ink-400); }
.cf-foot { margin: 0; text-align: center; }
.cf-foot b { color: var(--sos-ink-700); font-weight: 700; }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; }
.gauge { width: 140px; height: 104px; overflow: visible; }
.gauge .g-track { fill: none; stroke: var(--sos-ink-100); stroke-width: 13; stroke-linecap: round; }
.gauge .g-fill { fill: none; stroke-width: 13; stroke-linecap: round; transition: stroke-dasharray .4s var(--ease-out); }
.gauge .g-low { stroke: var(--sos-lost-600); }
.gauge .g-mid { stroke: var(--sos-risk-600); }
.gauge .g-ok { stroke: var(--mo, var(--tk-primary)); }
.gauge .g-done { stroke: var(--sos-signal-600); }
.g-read { text-align: center; margin-top: -26px; }
.g-v { font-size: 22px; font-weight: 700; color: var(--sos-ink-900); }
.g-t { font-size: 12px; color: var(--sos-ink-500); margin-top: 2px; }

/* ------------------------------------------------------------ view chips */
.viewchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.viewchips .chip-cog { padding: 7px 9px; color: var(--sos-ink-400); }
.viewchips .chip-cog .ic { width: 15px; height: 15px; }
.viewchips .chip-cog:hover { color: var(--tk-primary); }
.tmpl-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tmpl {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  border: 1px dashed var(--sos-ink-300); background: none; border-radius: var(--r-pill);
  padding: 5px 11px 5px 8px; color: var(--sos-ink-500); cursor: pointer;
}
.tmpl:hover { border-color: var(--tk-primary); color: var(--tk-primary); background: var(--sos-brand-50); border-style: solid; }
.tmpl .ic { width: 13px; height: 13px; }
.sec-row .ord { display: flex; gap: 4px; flex: none; }
.sec-row .ord .ib-lite .ic { transform: rotate(90deg); }

/* Grid items refuse to shrink below their content unless told (min-width:auto
   is the default). A long deal name would otherwise push the card past its
   stage — the same trap the role blocks hit. */
.fnl-cards > *, .kb-card > *, .kb-card .t > * { min-width: 0; }
.kb-card .nx, .kb-card .og, .kb-card .m { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
