/* ==========================================================================
   /sales-intelligence. Rides on /mcp's sheet (mcp.css) for the hero frame, the
   buttons, the reveal, the dark list and the CTA; this file is only what that
   page does not have: the deal-trace card, the number grid, the setter/closer
   scoreboard, the objection fingerprint and the campaign table.

   Motion follows mcp.css: --cx-expo for entrances, --cx-out for exits, and
   transform/opacity only. One addition, --cx-glide, for the one thing that moves
   across the screen rather than in or out of it (the segmented control's thumb).
   si.js arms each moving part; the markup alone draws the finished still.
   ========================================================================== */
:root {
  --cx-glide: cubic-bezier(0.32, 0.72, 0, 1);   /* iOS's sheet curve: on-screen movement */
  --cx-good: #15803d;                          /* status: won / leads. AA on white */
  --cx-bad:  #c2410c;                          /* status: lost / weak. AA on white */
}

/* --------------------------------------------------------------------------
   1. Hero — /mcp's copy column; the card is a deal, traced
   -------------------------------------------------------------------------- */
.cx-sitrace {
  box-sizing: border-box; flex: 0 1 561px; width: 561px; min-width: 0; height: 604px; margin-top: 155px;
  display: grid; overflow: hidden;
  background: rgba(250, 250, 249, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px;
  color: var(--cx-inverse);
}
.cx-sitrace p { margin: 0; }
/* both deals share one cell, so swapping them never moves anything */
.cx-sitrace__deal {
  grid-area: 1 / 1; min-height: 0; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 260ms var(--cx-out), visibility 0s linear 260ms;
}
.cx-sitrace__deal.is-on { opacity: 1; visibility: visible; transition: opacity 500ms var(--cx-expo) 120ms, visibility 0s; }

.cx-sitrace__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cx-sitrace__who { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; line-height: 20px; }
.cx-sitrace__mark { width: 14px; height: 14px; filter: invert(1); }
.cx-sitrace__out { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: #22c55f; font-variant-numeric: tabular-nums; }
.cx-sitrace__deal.is-lost .cx-sitrace__out { color: #f97318; }
.cx-sitrace__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }

.cx-sitrace__steps { flex: 1 1 0; min-height: 0; margin: 0; padding: 22px 20px 8px; list-style: none; display: flex; flex-direction: column; }
.cx-sitrace__step { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
/* the rail: from this node down to the next */
.cx-sitrace__step:not(:last-child)::before {
  content: ""; position: absolute; left: 7.5px; top: 14px; bottom: -4px; width: 1px;
  background: rgba(255, 255, 255, 0.14); transform-origin: 50% 0;
}
.cx-sitrace__node {
  position: relative; z-index: 1; box-sizing: border-box; width: 9px; height: 9px; margin: 5px 0 0 3.5px;
  border-radius: 50%; border: 1.5px solid rgba(250, 250, 249, 0.45); background: var(--cx-dark);
}
.cx-sitrace__step:last-child .cx-sitrace__node { border-color: #22c55f; background: #22c55f; }
.cx-sitrace__deal.is-lost .cx-sitrace__step:last-child .cx-sitrace__node { border-color: #f97318; background: #f97318; }
.cx-sitrace__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-sitrace__k { font-size: 12px; line-height: 16px; color: var(--cx-ink-3); }
.cx-sitrace__t { font-size: 14px; line-height: 20px; font-weight: 500; }
.cx-sitrace__m { font-size: 12px; line-height: 16px; color: rgba(250, 250, 249, 0.62); font-variant-numeric: tabular-nums; }
.cx-sitrace__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cx-sitrace__chip {
  padding: 3px 8px; border-radius: var(--cx-r-md);
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 12px; line-height: 16px; color: rgba(250, 250, 249, 0.82); font-variant-numeric: tabular-nums;
}
.cx-sitrace__chip.is-good { color: #4ade80; background: rgba(34, 197, 95, 0.1); box-shadow: inset 0 0 0 1px rgba(34, 197, 95, 0.2); }
.cx-sitrace__chip.is-bad  { color: #fb923c; background: rgba(249, 115, 24, 0.1); box-shadow: inset 0 0 0 1px rgba(249, 115, 24, 0.22); }
.cx-sitrace__foot {
  display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px; line-height: 16px; color: var(--cx-ink-3); font-variant-numeric: tabular-nums;
}
.cx-sitrace__foot > :first-child { color: var(--cx-inverse); font-weight: 500; }

/* the card settles in a beat after the copy, as /mcp's does */
@media (prefers-reduced-motion: no-preference) {
  .cx-sitrace { animation: cx-mcard-in 1100ms var(--cx-expo) 260ms both; }
}

/* The play (si.js). `is-armed` only once the script runs. Each step rises in, its
   rail draws down toward the next, its chips follow; the outcome in the head and
   the attribution in the foot land last, when the trace is complete. */
.cx-sitrace.is-armed .cx-sitrace__step { opacity: 0; transform: translateY(8px); transition: opacity 400ms var(--cx-expo), transform 600ms var(--cx-expo); }
.cx-sitrace.is-armed .cx-sitrace__step::before { transform: scaleY(0); transition: transform 600ms var(--cx-expo) 180ms; }
.cx-sitrace.is-armed .cx-sitrace__chip { opacity: 0; transform: translateY(4px); transition: opacity 300ms var(--cx-expo), transform 400ms var(--cx-expo); transition-delay: calc(220ms + var(--c, 0) * 90ms); }
.cx-sitrace.is-armed .cx-sitrace__step.is-in { opacity: 1; transform: none; }
.cx-sitrace.is-armed .cx-sitrace__step.is-in::before { transform: none; }
.cx-sitrace.is-armed .cx-sitrace__step.is-in .cx-sitrace__chip { opacity: 1; transform: none; }
.cx-sitrace.is-armed :is(.cx-sitrace__out, .cx-sitrace__foot) { opacity: 0; transition: opacity 300ms var(--cx-out); }
.cx-sitrace.is-armed .cx-sitrace__deal.is-done :is(.cx-sitrace__out, .cx-sitrace__foot) { opacity: 1; transition: opacity 500ms var(--cx-expo); }
/* the last node lands with a little weight — from 0.6, never from nothing */
@keyframes cx-sinode { from { transform: scale(0.6); } }
.cx-sitrace.is-armed .cx-sitrace__step.is-in:last-child .cx-sitrace__node { animation: cx-sinode 500ms var(--cx-expo); }

/* --------------------------------------------------------------------------
   2. The numbers your CRM can't see — eight readouts
   -------------------------------------------------------------------------- */
.cx-sinums {   /* the 1px gap over a line-coloured ground draws the rules, at any column count */
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none;
  background: var(--cx-line); border: 1px solid var(--cx-line);
}
.cx-sinums__cell { display: flex; flex-direction: column; gap: 10px; min-height: 232px; padding: 28px; background: var(--cx-surface); }
.cx-sinums__cell p { margin: 0; }
.cx-sinums__n { font-weight: 500; font-size: 16px; line-height: 24px; color: var(--cx-ink); }
.cx-sinums__v {
  margin-top: auto !important; font-family: var(--cx-display); font-size: 56px; line-height: 60px; letter-spacing: -1.6px;
  color: var(--cx-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cx-sinums__d { max-width: 240px; }

/* --------------------------------------------------------------------------
   3. Setters and closers — a segmented control over two tables
   -------------------------------------------------------------------------- */
.cx-siboard { display: flex; flex-direction: column; background: var(--cx-surface); border: 1px solid var(--cx-line); }
.cx-siboard__panels { border-top: 1px solid var(--cx-line); }
.cx-siboard__note {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 20px;
  border-top: 1px solid var(--cx-line); font-size: 13px; line-height: 18px; color: var(--cx-ink-2);
}
.cx-siboard__key { width: 6px; height: 6px; border-radius: 50%; background: var(--cx-good); }

/* The control. The thumb is one element that glides between the two slots; the
   buttons sit over it. It moves on a transition, so a second tap mid-glide simply
   retargets from wherever the thumb is. */
.cx-siseg {
  position: relative; align-self: flex-start; display: inline-grid; grid-template-columns: 1fr 1fr;
  margin: 16px 20px; padding: 3px; border-radius: 10px; background: var(--cx-subtle);
  box-shadow: inset 0 0 0 1px var(--cx-line);
}
.cx-siseg__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px;
  background: var(--cx-surface);
  box-shadow: 0 1px 2px rgba(38, 38, 38, 0.08), 0 0 0 0.5px rgba(38, 38, 38, 0.06);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 280ms var(--cx-glide);
}
.cx-siseg__btn {
  position: relative; z-index: 1; min-width: 104px; height: 32px; padding: 0 18px;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: 500 14px/20px var(--cx-sans); letter-spacing: -0.09px; color: var(--cx-ink-2);
  transition: color 200ms ease, transform 160ms var(--cx-out);
  -webkit-tap-highlight-color: transparent;
}
.cx-siseg__btn.is-on { color: var(--cx-ink); }
.cx-siseg__btn:active { transform: scale(0.97); }
.cx-siseg__btn:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 1px; }
@media (hover: hover) { .cx-siseg__btn:not(.is-on):hover { color: var(--cx-ink); } }

/* Tables — shared by the scoreboard and the campaigns. They scroll sideways inside
   their own box on narrow screens; the page never does. */
.cx-sitable { overflow-x: auto; overscroll-behavior-x: contain; }
.cx-sitable:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: -2px; }
.cx-sitable table { width: 100%; min-width: 720px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cx-sitable th, .cx-sitable td { padding: 14px 20px; text-align: right; white-space: nowrap; font-size: 15px; line-height: 22px; }
.cx-sitable :is(th, td):first-child { text-align: left; }
.cx-sitable thead th { padding-top: 12px; padding-bottom: 12px; font-weight: 400; font-size: 13px; line-height: 18px; color: var(--cx-ink-2); }
.cx-sitable tbody tr { border-top: 1px solid var(--cx-line); }
.cx-sitable tbody th { font-weight: 500; color: var(--cx-ink); }
.cx-sitable td { color: var(--cx-ink-2); }
.cx-sitable td.is-lead { color: var(--cx-ink); font-weight: 500; }
.cx-sitable td.is-lead::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0; border-radius: 50%;
  background: var(--cx-good); vertical-align: middle;
}
/* a panel that comes in lays its rows down in order — short, and only ever on a switch */
@keyframes cx-sirow { from { opacity: 0; transform: translateY(4px); } }
.cx-siboard.is-armed .cx-siboard__panel.is-on tbody tr { animation: cx-sirow 300ms var(--cx-expo) both; animation-delay: calc(var(--r, 0) * 30ms); }

/* --------------------------------------------------------------------------
   4. Objection fingerprint — win rate per rep per objection, and the fix
   -------------------------------------------------------------------------- */
.cx-sifp { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); background: var(--cx-surface); border: 1px solid var(--cx-line); }
.cx-sifp__grid { display: flex; flex-direction: column; gap: 2px; padding: 20px; border-right: 1px solid var(--cx-line); overflow-x: auto; }
.cx-sifp__row {
  display: grid; grid-template-columns: 96px repeat(6, minmax(52px, 1fr)); gap: 4px; align-items: center;
  min-width: 520px; padding: 4px; border-radius: 10px;
}
.cx-sifp__hdr { padding-bottom: 6px; }
.cx-sifp__col { font-size: 12px; line-height: 16px; color: var(--cx-ink-2); text-align: center; text-wrap: balance; }
.cx-sifp__rep {
  border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background-color 200ms ease, transform 160ms var(--cx-out);
  -webkit-tap-highlight-color: transparent;
}
.cx-sifp__rep.is-on { background: var(--cx-subtle); box-shadow: inset 0 0 0 1px var(--cx-line); }
.cx-sifp__rep:active { transform: scale(0.99); }
.cx-sifp__rep:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 0; }
@media (hover: hover) { .cx-sifp__rep:not(.is-on):hover { background: rgba(38, 38, 38, 0.03); } }
.cx-sifp__name { padding-left: 8px; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--cx-ink); }
/* one hue, light → dark, for "how often they win it"; the number is always printed */
.cx-sifp__cell {
  position: relative; display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 6px;
  background: rgb(21 128 61 / var(--a)); font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; color: var(--cx-ink);
}
.cx-sifp__cell.is-dark { color: #fff; }
/* the weak spot drops the ramp for its own pale ground, so the orange stays legible at any value */
.cx-sifp__cell.is-weak { background: #fff7ed; box-shadow: inset 0 0 0 2px var(--cx-bad); color: var(--cx-bad); font-weight: 500; }
.cx-sifp__legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; padding: 0 8px;
  font-size: 12px; line-height: 16px; color: var(--cx-ink-2);
}
.cx-sifp__ramp { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.cx-sifp__ramp > i:first-of-type { margin-left: 4px; }
.cx-sifp__ramp > i:last-of-type { margin-right: 4px; }
.cx-sifp__ramp i { width: 18px; height: 10px; border-radius: 2px; background: rgb(21 128 61 / var(--a)); }
.cx-sifp__weakkey { display: inline-flex; align-items: center; gap: 6px; }
.cx-sifp__weakkey i { width: 14px; height: 10px; border-radius: 2px; box-shadow: inset 0 0 0 2px var(--cx-bad); }

.cx-sifp__panel { display: grid; padding: 32px; }
.cx-sifp__coach { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; }
.cx-sifp__coach[hidden] { display: none; }
.cx-sifp__coach p { margin: 0; }
.cx-sifp__weak { font-family: var(--cx-serif); font-size: 40px; line-height: 44px; letter-spacing: -0.6px; color: var(--cx-ink); text-wrap: balance; }
.cx-sifp__line {
  margin: 12px 0 0; padding: 16px 18px; border-radius: 10px; background: rgba(34, 197, 95, 0.07);
  font-family: var(--cx-serif); font-size: 22px; line-height: 28px; color: var(--cx-ink);
}
.cx-sifp__by { display: block; margin-top: 8px; font-family: var(--cx-sans); font-size: 13px; line-height: 18px; color: var(--cx-good); }
/* the panel swaps: in with a small rise and a de-blur, the same as /mcp's prompt stage */
@keyframes cx-sicoach { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
.cx-sifp.is-armed .cx-sifp__coach:not([hidden]) { animation: cx-sicoach 500ms var(--cx-expo) both; }

/* --------------------------------------------------------------------------
   5. Back to the marketing — the drill path and the campaign table
   -------------------------------------------------------------------------- */
.cx-sidrill { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; margin: -24px 0 0; padding: 0; list-style: none; }
.cx-sidrill__step { display: inline-flex; align-items: center; gap: 8px; }
.cx-sidrill__step:not(:last-child)::after { content: "→"; color: var(--cx-ink-3); }
.cx-sidrill__pill {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--cx-r-full);
  background: var(--cx-surface); box-shadow: inset 0 0 0 1px var(--cx-line-strong);
  font-size: 14px; line-height: 20px; color: var(--cx-ink);
}
.cx-sidrill__step:last-child .cx-sidrill__pill { background: var(--cx-ink); color: var(--cx-inverse); box-shadow: none; }

.cx-sicamps { background: var(--cx-surface); border: 1px solid var(--cx-line); }
.cx-sicamps__close { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.cx-sicamps__bar { display: block; width: calc(var(--w) * 64px); height: 4px; border-radius: 2px; background: var(--cx-good); transform-origin: 0 50%; }
.cx-sitable tr.is-loss .cx-sicamps__bar { background: var(--cx-bad); }
.cx-sitable tr.is-loss :is(th, .cx-sicamps__close) { color: var(--cx-bad); }
.cx-sitable .cx-sicamps__obj { text-align: left; color: var(--cx-ink); }
.cx-sitable--camps th:nth-child(6) { text-align: left; }
.cx-sicamps__call {
  margin: 0; padding: 18px 20px; border-top: 1px solid var(--cx-line); background: rgba(249, 115, 24, 0.05);
  font-size: 16px; line-height: 24px; letter-spacing: -0.09px; color: var(--cx-ink-2);
}
.cx-sicamps__call b { font-weight: 500; color: var(--cx-ink); }
/* the bars grow to their value once the table has risen in */
html.cx-reveal .cx-sicamps .cx-sicamps__bar { transform: scaleX(0); transition: transform 800ms var(--cx-expo); transition-delay: calc(var(--r, 0) * 70ms + 320ms); }
html.cx-reveal .cx-sicamps.is-in .cx-sicamps__bar { transform: none; }

/* --------------------------------------------------------------------------
   6. Sentence case, as on /mcp (its eyebrow override is scoped to .cx-mcp)
   -------------------------------------------------------------------------- */
.cx-si .cx-psec__eyebrow,
.cx-si .cx-eyebrow {
  font-family: var(--cx-sans); font-size: 14px; line-height: 20px; letter-spacing: -0.09px;
  text-transform: none; color: var(--cx-ink-2);
}
.cx-si .cx-strip.inverse .cx-strip__eyebrow { color: var(--cx-inverse); }

/* --------------------------------------------------------------------------
   7. Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .cx-sitrace { flex: none; width: 100%; height: auto; min-height: 580px; margin-top: 0; }
  .cx-sinums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-sinums__cell { min-height: 200px; }
  .cx-sifp { grid-template-columns: 1fr; }
  .cx-sifp__grid { border-right: 0; border-bottom: 1px solid var(--cx-line); }
  .cx-sifp__panel { padding: 24px; }
  .cx-sidrill { margin-top: -8px; }
}
@media (max-width: 767px) {
  .cx-sitrace__steps { flex: none; padding: 18px 14px 4px; }   /* the card is auto-height here; a 0 basis would clip */
  .cx-sitrace__head, .cx-sitrace__foot { padding-left: 14px; padding-right: 14px; }
  .cx-sinums__cell { padding: 20px; gap: 8px; }
  .cx-sinums__v { font-size: 40px; line-height: 44px; letter-spacing: -1px; }
  .cx-siseg { margin: 12px; }
  .cx-sitable th, .cx-sitable td { padding: 12px 14px; font-size: 14px; }
  .cx-sifp__grid { padding: 12px 8px; }
  /* all six objections fit a 350 column, so every weak spot is on screen without a sideways scroll */
  .cx-sifp__row { grid-template-columns: 58px repeat(6, minmax(0, 1fr)); gap: 3px; min-width: 0; padding: 3px; }
  .cx-sifp__name { padding-left: 4px; font-size: 12px; line-height: 16px; }
  .cx-sifp__col { font-size: 11px; line-height: 14px; }
  .cx-sifp__cell { height: 38px; font-size: 11px; letter-spacing: -0.2px; }
  .cx-sifp__weak { font-size: 32px; line-height: 36px; }
  .cx-sifp__line { font-size: 19px; line-height: 25px; }
  .cx-sidrill__pill { font-size: 13px; height: 28px; }
}
@media (max-width: 479px) {
  .cx-sinums { grid-template-columns: 1fr; }
  .cx-sinums__cell { min-height: 0; }
}

/* Reduced motion: nothing slides, nothing blurs. State changes stay, as fades. */
@media (prefers-reduced-motion: reduce) {
  .cx-siseg__thumb { transition: none; }
  .cx-siseg__btn, .cx-sifp__rep { transition: color 200ms ease, background-color 200ms ease; }
  .cx-siseg__btn:active, .cx-sifp__rep:active { transform: none; }
  .cx-sitrace__deal, .cx-sitrace__deal.is-on { transition: none; }
}
