/* ============================================================
   intel.css — "Call Intelligence" set piece (.cx-in).
   A bright sand-blue analytics board (waveform, count-up KPIs,
   sentiment sparkline, drafted follow-up) over an editorial light
   head — dark-on-light throughout, no navy anywhere. De-boxed —
   one elevated LIGHT board, hairline internal dividers only.
   Tokens inherited from styles.css. Accent = sand-blue + house indigo.
   Every selector namespaced under .cx-in.
   ============================================================ */

.cx-in {
  --cxin-teal: #5a82c2;
  --cxin-teal-deep: #3d63a4;
  /* On the LIGHT board this "accent-lite" is used for text (draft eyebrow/cta,
     highlighted KPI, wave-tag) as well as decorative fills, so it must stay
     legible on white — deepened from the old on-dark #8aa6dd to sand-blue deep. */
  --cxin-teal-lite: #3d63a4;
  --cxin-line: var(--line-2);
  --cxin-line-soft: var(--line);
  --cxin-txt: var(--ink);
  --cxin-txt-60: #4a5066;
  --cxin-txt-40: #7a8096;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(110% 60% at 85% 0%, var(--periwinkle) 0%, transparent 52%),
    linear-gradient(180deg, var(--paper), #fff 40%);
  overflow: clip;
}

/* ── head + points, editorial two-column ── */
.cx-in-top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
}
.cx-in .cx-head .eyebrow {
  color: var(--cxin-teal-deep);
}
.cx-in .cx-head h2 {
  margin: 14px 0 12px;
}

.cx-in-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.cx-in-point {
  display: grid;
  gap: 5px;
  padding: clamp(14px, 1.6vw, 19px) 0 clamp(14px, 1.6vw, 19px) 22px;
  position: relative;
}
.cx-in-point + .cx-in-point {
  border-top: 1px solid var(--line);
}
/* hairline tick instead of a bullet — de-boxed marker */
.cx-in-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(clamp(14px, 1.6vw, 19px) + 0.62em);
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cxin-teal), var(--indigo));
}
.cx-in-point b {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cx-in-point span {
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink-60);
  max-width: 46ch;
}

/* ============================================================
   THE BOARD — one bright elevated surface, sand-blue analytics calm
   ============================================================ */
.cx-in-board {
  position: relative;
  margin-top: clamp(34px, 4.5vw, 60px);
  border-radius: var(--r-xl);
  padding: clamp(20px, 2.6vw, 34px) clamp(20px, 2.8vw, 38px);
  background:
    radial-gradient(90% 120% at 12% -10%, rgba(59, 79, 224, 0.08), transparent 55%),
    radial-gradient(70% 100% at 92% 110%, rgba(90, 130, 194, 0.1), transparent 60%),
    linear-gradient(168deg, #ffffff, #f4f7fc 62%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float), 0 30px 80px -34px rgba(61, 99, 164, 0.2);
  color: var(--cxin-txt);
  overflow: hidden;
}
/* faint top sheen so the light surface reads machined, not flat */
.cx-in-board-glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 4%,
    rgba(90, 130, 194, 0.5) 30%,
    rgba(11, 16, 32, 0.12) 55%,
    transparent 92%
  );
  pointer-events: none;
}

/* ── board header ── */
.cx-in-bar {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-bottom: clamp(14px, 1.6vw, 20px);
  border-bottom: 1px solid var(--cxin-line);
}
.cx-in-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cxin-txt);
  white-space: nowrap;
}
.cx-in-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cxin-teal-lite);
  box-shadow: 0 0 0 0 rgba(90, 130, 194, 0.45);
  animation: cx-in-pulse 1.4118s ease-out infinite;
}
@keyframes cx-in-pulse {
  0% { box-shadow: 0 0 0 0 rgba(90, 130, 194, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(90, 130, 194, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 130, 194, 0); }
}
.cx-in-bar-note {
  font-size: 12.5px;
  color: var(--cxin-txt-40);
  white-space: nowrap;
}
.cx-in-bar-range {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--cxin-txt-40);
  white-space: nowrap;
}

/* ── waveform strip ── */
.cx-in-wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  height: clamp(74px, 9vw, 104px);
  padding: clamp(20px, 2.4vw, 30px) 0 clamp(10px, 1.4vw, 14px);
  box-sizing: content-box;
}
.cx-in-wavebar {
  flex: 1 1 0;
  min-width: 0;
  height: var(--h, 40%);
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(90, 130, 194, 0.9),
    rgba(90, 130, 194, 0.42)
  );
  opacity: 0.85;
  transform-origin: center;
  will-change: transform;
}
.cx-in-wavebar.is-hot {
  background: linear-gradient(180deg, #8aa6dd, var(--cxin-teal));
  opacity: 1;
  box-shadow: 0 0 14px rgba(90, 130, 194, 0.4);
}
/* marker chip anchored over the hot cluster */
.cx-in-wave-tag {
  position: absolute;
  top: 0;
  left: 61%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(90, 130, 194, 0.32);
  background: rgba(90, 130, 194, 0.1);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--cxin-teal-lite);
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.cx-in-wave-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cxin-teal-lite);
}

/* ── KPI row — dividers, not cards ── */
.cx-in-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--cxin-line);
  border-bottom: 1px solid var(--cxin-line);
}
.cx-in-kpi {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: clamp(18px, 2vw, 26px) clamp(16px, 2vw, 28px);
}
.cx-in-kpi + .cx-in-kpi {
  border-left: 1px solid var(--cxin-line-soft);
}
.cx-in-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cxin-txt-40);
}
.cx-in-kpi-num {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--cxin-txt);
  font-variant-numeric: tabular-nums;
}
.cx-in-kpi:last-child .cx-in-kpi-num {
  color: var(--cxin-teal-lite);
}
.cx-in-kpi-sub {
  font-size: 12.5px;
  color: var(--cxin-txt-60);
}

/* ── foot: sparkline + drafted follow-up ── */
.cx-in-foot {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 3.4vw, 52px);
  align-items: end;
  padding-top: clamp(18px, 2.2vw, 26px);
}
.cx-in-spark {
  display: grid;
  gap: 12px;
}
.cx-in-spark-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cxin-txt-40);
}
.cx-in-spark-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 54px;
}
.cx-in-spark-bars i {
  flex: 1 1 0;
  height: var(--h, 40%);
  max-width: 18px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--cxin-teal-lite), rgba(90, 130, 194, 0.38));
}
/* down/negative sentiment days read as a muted rose against the sand-blue */
.cx-in-spark-bars i.is-dip {
  background: linear-gradient(180deg, rgba(198, 128, 148, 0.75), rgba(198, 128, 148, 0.32));
}

/* the point of the whole board: a follow-up, not a report */
.cx-in-draft {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: clamp(16px, 1.8vw, 24px);
  border-left: 2px solid rgba(90, 130, 194, 0.6);
}
.cx-in-draft-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cxin-teal-lite);
}
.cx-in-draft-body {
  margin: 0;
  font-size: clamp(14.5px, 1.3vw, 16.5px);
  line-height: 1.6;
  color: var(--cxin-txt);
  max-width: 52ch;
}
.cx-in-draft-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cxin-teal-lite);
}
.cx-in-draft-cta .arrow {
  transition: transform 0.22s ease;
}
.cx-in-board:hover .cx-in-draft-cta .arrow {
  transform: translateX(3px);
}

/* ── closing caption ── */
.cx-in-caption {
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--ink-40);
  letter-spacing: 0.01em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .cx-in-top {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cx-in-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .cx-in-kpi {
    border-top: 1px solid var(--cxin-line-soft);
  }
  .cx-in-kpi:nth-child(-n + 2) {
    border-top: 0;
  }
  .cx-in-kpi:nth-child(3) {
    border-left: 0;
  }
  .cx-in-foot {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
@media (max-width: 700px) {
  .cx-in-kpis {
    grid-template-columns: 1fr;
  }
  .cx-in-kpi {
    border-left: 0 !important;
    border-top: 1px solid var(--cxin-line-soft);
  }
  .cx-in-kpi:first-child {
    border-top: 0;
  }
  .cx-in-board {
    padding: clamp(16px, 4vw, 22px);
  }
}
@media (max-width: 640px) {
  .cx-in-bar {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .cx-in-bar-note {
    display: none;
  }
  .cx-in-wave-tag {
    left: auto;
    right: 0;
    transform: none;
  }
  /* halve bar density on small screens (the tag is not a wavebar, unaffected) */
  .cx-in-wavebar:nth-child(2n + 1) {
    display: none;
  }
}
@media (max-width: 460px) {
  .cx-in-kpi-num {
    font-size: 22px;
  }
  .cx-in-draft-body {
    font-size: 14px;
  }
}

/* ============================================================
   REDUCED MOTION — static board, final numbers, no pulse
   ============================================================ */
@media (prefers-reduced-motion: reduce), (max-width: 700px) {
  .cx-in-live-dot {
    animation: none;
  }
  .cx-in-draft-cta .arrow {
    transition: none;
  }
}
