/* =========================================================
   PILLAR DIAGRAMS
   Light, conceptual diagrams for the three feature sections.
   Replaces the dense dark mock-cards.

   Visual rules (shared):
   - 4:3 canvas, off-white surface, warm-neutral border, 14px radius
   - One accent color per pillar, used minimally
   - Inter Tight typography, monospace only for system signals
   - Soft Bezier connectors, never right-angled
   - Calm, quiet — not a trading floor
   ========================================================= */

.pillar-diagram {
  --pd-fg:     var(--ink);
  --pd-fg-sec: var(--ink-soft);
  --pd-bg:     #FFFFFF;
  --pd-border: var(--line);
  --pd-surface: #ffffff;
  --pd-accent: var(--accent);
  --pd-accent-rgb: 255, 88, 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.feature-row:not(.reverse) .pillar-diagram { margin-right: 0; }
.feature-row.reverse        .pillar-diagram { margin-left: 0; }

.pd-insurance {
  --pd-accent: var(--accent);
  --pd-accent-rgb: 255, 88, 0;
}
.pd-customers {
  --pd-accent: #2E8B57;
  --pd-accent-rgb: 46, 139, 87;
}

.pd-canvas {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--pd-bg);
  border: 1px solid var(--pd-border);
  border-radius: 14px;
  padding: 32px;
  font-family: var(--font-body);
  color: var(--pd-fg);
  box-sizing: border-box;
  container-type: inline-size;
}

.pd-punchline {
  text-align: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 19px;
  color: var(--pd-fg);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.pd-punchline em {
  font-style: normal;
  color: var(--pd-accent);
  font-weight: 600;
}

/* =========================================================
   PILLAR 1 — PARTS FLOW DIAGRAM
   Horizontal 3-column process: doc → suppliers → cart+CTA
   ========================================================= */

/* Sit the diagram inside a white card. */
.feature-mock:has(.pd-flow) {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(26,23,20,0.04), 0 8px 24px -12px rgba(26,23,20,0.08);
  padding: 40px 32px;
  border-radius: 16px;
}

.pd-flow {
  --pd-ink-1:       #1A1714;
  --pd-ink-2:       #5A544C;
  --pd-ink-3:       #8C8479;
  --pd-surface:     #FAFAFA;
  --pd-hair:        #E8E0D6;
  --pd-orange:      #FF5800;
  --pd-orange-deep: #DB4B00;
  --pd-orange-soft: rgba(255, 88, 0, 0.04);
  --pd-orange-tag:  rgba(255, 88, 0, 0.12);
  --pd-green:       #4A9B7E;
  --pd-green-soft:  rgba(74, 155, 126, 0.10);

  background: transparent;
  border: none;
  padding: 16px 0;
  font-family: var(--font-body);
  color: var(--pd-ink-1);
  width: 100%;
  box-sizing: border-box;
  container-type: inline-size;
}

.pd-flow-grid {
  display: grid;
  grid-template-columns: 0.55fr 56px 1.3fr 56px 1.3fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "doc  arr1 sups arr2 cart"
    "cap1 .    cap2 .    cap3";
  align-items: center;
  column-gap: 20px;
  row-gap: 18px;
}
.pd-flow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.pd-flow-col-left  { grid-area: doc;  align-self: center; }
.pd-flow-col-mid   { grid-area: sups; align-self: center; width: 100%; }
.pd-flow-col-right { grid-area: cart; align-self: center; width: 100%; }
.pd-flow-cap-left  { grid-area: cap1; align-self: end; }
.pd-flow-cap-mid   { grid-area: cap2; align-self: end; }
.pd-flow-cap-right { grid-area: cap3; align-self: end; }
.pd-flow-arrow-1   { grid-area: arr1; }
.pd-flow-arrow-2   { grid-area: arr2; }

/* ============== DOCUMENT (left) ============== */
.pd-flow-doc {
  width: 104px;
  height: 132px;
  flex-shrink: 0;
}
.pd-flow-doc svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pd-flow-doc .doc-page-fill { fill: var(--pd-surface); opacity: 0.5; }
.pd-flow-doc .doc-stroke { stroke: var(--pd-ink-1); fill: none; }
.pd-flow-doc .pdf-pill-bg { fill: var(--pd-orange-tag); }
.pd-flow-doc .pdf-pill-text {
  fill: var(--pd-orange);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.pd-flow-doc .doc-line { stroke: var(--pd-ink-2); opacity: 0.4; }
.pd-flow-doc .doc-dollar {
  fill: var(--pd-ink-3);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 500;
}

/* ============== ARROWS (rounded filled triangles) ============== */
.pd-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 100%;
  height: 36px;
}
.pd-flow-arrow svg { display: block; width: 22px; height: 36px; }
.pd-flow-arrow .arrow-triangle {
  fill: var(--pd-orange);
  stroke: var(--pd-orange);
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
}

/* ============== SUPPLIER CARD (middle) ============== */
.pd-flow-suppliers {
  width: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pd-hair);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}
.pd-flow-suppliers-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--pd-hair);
  background: #ffffff;
}
.pd-flow-suppliers-head .head-phone {
  width: 14px; height: 14px;
  color: var(--pd-ink-2);
}
.pd-flow-suppliers-head .head-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  color: var(--pd-ink-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1;
}
.pd-flow-suppliers-head .head-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  color: var(--pd-orange);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pd-flow-suppliers-head .live-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--pd-orange);
  animation: pd-flow-pulse 1.4s ease-in-out infinite;
}

.pd-flow-supplier {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid var(--pd-hair);
  background: #ffffff;
}
.pd-flow-supplier.state-active   { background: var(--pd-orange-soft); }
.pd-flow-supplier.state-complete { background: var(--pd-green-soft); }

.pd-flow-supplier-phone {
  width: 16px; height: 16px;
  display: block;
}
.pd-flow-supplier-phone .phone-fill { opacity: 0.3; }
.state-active   .pd-flow-supplier-phone { color: var(--pd-orange); }
.state-active   .pd-flow-supplier-phone .phone-fill { fill: var(--pd-orange); }
.state-complete .pd-flow-supplier-phone { color: var(--pd-green); }
.state-complete .pd-flow-supplier-phone .phone-fill { fill: var(--pd-green); }
.state-idle     .pd-flow-supplier-phone { color: var(--pd-ink-3); }
.state-idle     .pd-flow-supplier-phone .phone-fill { opacity: 0; }

.pd-flow-supplier-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pd-flow-supplier-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--pd-ink-1);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.pd-flow-supplier-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--pd-ink-2);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-flow-supplier-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
}
.pd-flow-supplier-right .oncall-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pd-orange);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pd-flow-supplier-right .oncall-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--pd-orange);
  animation: pd-flow-pulse 1.4s ease-in-out infinite;
}
.pd-flow-supplier-right .price { color: var(--pd-ink-1); }
.pd-flow-supplier-right .check-badge {
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--pd-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.pd-flow-supplier-right .check-badge svg { width: 9px; height: 9px; }

@keyframes pd-flow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.2); }
}

/* ============== CART STACK + CTA (right) ============== */
.pd-flow-cart-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pd-hair);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}
.pd-flow-cart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pd-hair);
}
.pd-flow-cart-head .head-icon { width: 14px; height: 14px; flex-shrink: 0; }
.pd-flow-cart-head .head-icon .cart-body-fill { fill: var(--pd-orange); opacity: 0.25; }
.pd-flow-cart-head .head-icon .cart-body-stroke { stroke: var(--pd-ink-1); fill: none; }
.pd-flow-cart-head .head-label {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  color: var(--pd-ink-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pd-flow-cart-head .head-count {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  color: var(--pd-ink-2);
  white-space: nowrap;
}
.pd-flow-cart-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--pd-hair);
}
.pd-flow-cart-thumb {
  width: 48px; height: 48px;
  border-radius: 6px;
  border: 1px solid var(--pd-hair);
  background: var(--pd-surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(26,23,20,0.06);
}
.pd-flow-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 3px;
  box-sizing: border-box;
}
.pd-flow-cart-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pd-flow-cart-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--pd-ink-1);
  letter-spacing: -0.005em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-flow-cart-num {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10.5px;
  color: var(--pd-ink-3);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-flow-cart-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}
.pd-flow-cart-price .amt {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--pd-green);
}
.pd-flow-cart-price .vendor {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10.5px;
  color: var(--pd-ink-3);
}
.pd-flow-cart-more {
  padding: 10px 14px;
  border-top: 1px solid var(--pd-hair);
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 11.5px;
  color: var(--pd-ink-3);
}
.pd-flow-cart-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1.5px solid var(--pd-hair);
  background: rgba(250, 247, 242, 0.6);
}
.pd-flow-cart-subtotal .sub-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--pd-ink-2);
  white-space: nowrap;
}
.pd-flow-cart-subtotal .sub-amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--pd-ink-1);
}

/* CTA — flush with the cart stack */
.pd-flow-cta {
  appearance: none;
  border: none;
  background: var(--pd-orange);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
  transition: background var(--dur-fast, 140ms) var(--ease-out, ease);
  white-space: nowrap;
}
.pd-flow-cta:hover { background: var(--pd-orange-deep); }
.pd-flow-cart-stack .pd-flow-cta {
  border-radius: 0;
  width: 100%;
  display: block;
  border-top: 1px solid var(--pd-orange-deep);
}

/* ============== CAPTIONS ============== */
.pd-flow-caption {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.pd-flow-caption-main {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--pd-ink-1);
  text-wrap: balance;
}
.pd-flow-caption-sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--pd-ink-2);
  letter-spacing: 0;
  text-wrap: balance;
}

/* ============== RESPONSIVE ============== */
@container (max-width: 720px) {
  .pd-flow { padding: 24px 0; }
  .pd-flow-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas: none;
    grid-auto-flow: row;
    gap: 20px;
    justify-items: center;
  }
  .pd-flow-col-left, .pd-flow-col-mid, .pd-flow-col-right,
  .pd-flow-cap-left, .pd-flow-cap-mid, .pd-flow-cap-right,
  .pd-flow-arrow-1, .pd-flow-arrow-2 { grid-area: auto; align-self: auto; }
  .pd-flow-arrow { transform: rotate(90deg); height: 32px; width: 32px; }
  .pd-flow-arrow svg { width: 24px; height: 32px; }
  .pd-flow-suppliers,
  .pd-flow-cart-stack { max-width: 440px; }
}

/* ============== REDUCED MOTION ============== */
@media (prefers-reduced-motion: reduce) {
  .pd-flow *,
  .pd-flow *::before,
  .pd-flow *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   PILLAR 2 — INSURANCE CHASE DIAGRAM
   Paro nudges adjuster across a dotted line; doc cycles
   submitted → under-review → disputed → negotiating → approved.
   ========================================================= */

/* Wrap container (optional — your existing card chrome) */
.feature-mock:has(.pd-chase) {
  background: #ffffff;
  border: 1px solid var(--line, #E8E0D6);
  box-shadow: 0 1px 0 rgba(26,23,20,0.04), 0 8px 24px -12px rgba(26,23,20,0.08);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}

.pd-chase {
  --ck-ink-1:   #1A1714;
  --ck-ink-2:   #5A544C;
  --ck-ink-3:   #8C8479;
  --ck-surface: #FAFAFA;
  --ck-hair:    #E8E0D6;
  --ck-orange:  #FF5800;
  --ck-orange-deep: #DB4B00;
  --ck-amber:   #D89233;
  --ck-green:   #4A9B7E;
  --ck-green-glow: rgba(74, 155, 126, 0.30);

  width: 100%;
  font-family: var(--font-body, system-ui, sans-serif);
  color: var(--ck-ink-1);
  container-type: inline-size;
}

.pd-chase-canvas {
  position: relative;
  /* Shorter aspect ratio = less canvas height = less empty space below labels.
     Padding stays vertically SYMMETRIC so icons + line move together via
     transform; any asymmetry would shift icons but not the absolute-positioned
     line, and they'd drift apart. */
  aspect-ratio: 2 / 1;
  background: #ffffff;
  /* Negative y-shift anchors the diagram to the TOP of the card. */
  --pd-chase-y-shift: -42px;
  --pd-chase-x-shift: 18px;
  padding: 20px 8px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 36fr 18fr 46fr;
  align-items: center;
  gap: 0;
  overflow: hidden;
}

/* ============== DOTTED CONNECTOR LINE ============== */
.pd-chase-line {
  position: absolute;
  top: calc(50% + var(--pd-chase-y-shift, 0px));
  left: 38%;
  right: 48%;
  height: 2px;
  background-image: radial-gradient(circle, var(--ck-ink-3) 1px, transparent 1.5px);
  background-size: 6px 2px;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.5;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}

/* ============== LEFT ZONE — PARO ============== */
.pd-chase-left {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  justify-self: end;
  grid-column: 1;
  transform: translate(calc(var(--pd-chase-x-shift, 0px) * -1), var(--pd-chase-y-shift, 0px));
}

.pd-chase-paro {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--ck-orange);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display, var(--font-body));
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  box-shadow: 0 0 28px rgba(228, 100, 37, 0.4), 0 2px 6px rgba(0,0,0,0.1);
  z-index: 3;
}
.pd-chase-paro-glyph { display: block; line-height: 1; transform: translateY(0.5px); }

/* Paro is static at rest — ring + pulse fire ONLY during a nudge telegraph. */
.pd-chase-paro-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ck-orange);
  pointer-events: none;
  opacity: 0;
  transform: scale(1);
}
.pd-chase-paro.telegraph .pd-chase-paro-ring {
  animation: pd-chase-paro-ring-burst 600ms ease-out;
}
@keyframes pd-chase-paro-ring-burst {
  0%   { opacity: 0.4; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.8); }
}
.pd-chase-paro.telegraph { animation: pd-chase-paro-telegraph 400ms ease-out; }
@keyframes pd-chase-paro-telegraph {
  0%, 100% { transform: scale(1);
             box-shadow: 0 0 28px rgba(228,100,37,0.2), 0 2px 6px rgba(0,0,0,0.1); }
  50%      { transform: scale(1.1);
             box-shadow: 0 0 36px rgba(228,100,37,0.4), 0 2px 6px rgba(0,0,0,0.1); }
}

/* ============== RIGHT ZONE — ADJUSTER + DOC ============== */
.pd-chase-right {
  position: relative;
  z-index: 2;
  justify-self: start;
  grid-column: 3;
  transform: translate(var(--pd-chase-x-shift, 0px), var(--pd-chase-y-shift, 0px));
}
.pd-chase-right-row {
  display: flex;
  align-items: center; /* shared horizontal axis for adjuster + doc */
  gap: 22px;
}
.pd-chase-adjuster-wrap,
.pd-chase-doc-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Adjuster */
.pd-chase-adjuster { position: relative; width: 148px; height: 148px; display: block; }
.pd-chase-adjuster svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pd-chase-adjuster .adj-stroke { stroke: var(--ck-ink-1); }
.pd-chase-adjuster .adj-body-fill { fill: var(--ck-surface); opacity: 0.55; }
.pd-chase-adjuster .adj-body-fill-inner { fill: var(--ck-surface); }
.pd-chase-adjuster .adj-tie { fill: var(--ck-ink-2); opacity: 0.55; }

/* Adjuster pulse — fires on orb arrival (step 2 of the chain). */
.pd-chase-adjuster::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ck-orange);
  pointer-events: none;
  opacity: 0;
  transform: scale(1);
}
.pd-chase-adjuster.pulse { animation: pd-chase-adj-scale 400ms ease-out; }
.pd-chase-adjuster.pulse::before { animation: pd-chase-adj-ring 500ms ease-out; }
.pd-chase-adjuster.pulse .adj-stroke { animation: pd-chase-adj-stroke-orange 400ms ease-out; }
.pd-chase-adjuster.pulse-amber::before { border-color: var(--ck-amber); }
.pd-chase-adjuster.pulse-amber .adj-stroke { animation: pd-chase-adj-stroke-amber 400ms ease-out; }
@keyframes pd-chase-adj-scale {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes pd-chase-adj-ring {
  0%   { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.6); }
}
@keyframes pd-chase-adj-stroke-orange {
  0%, 100% { stroke: var(--ck-ink-1); }
  50%      { stroke: var(--ck-orange); }
}
@keyframes pd-chase-adj-stroke-amber {
  0%, 100% { stroke: var(--ck-ink-1); }
  50%      { stroke: var(--ck-amber); }
}

/* Document */
.pd-chase-doc { position: relative; width: 148px; height: 192px; transition: filter 400ms ease-out; }
.pd-chase-doc svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pd-chase-doc .doc-page-fill { fill: var(--ck-surface); opacity: 0.8; }
.pd-chase-doc .doc-stroke { stroke: var(--ck-ink-1); transition: stroke 400ms ease-out; }
.pd-chase-doc .doc-line { stroke: var(--ck-ink-2); opacity: 0.3; transition: opacity 400ms ease-out, stroke 400ms ease-out; }
.pd-chase-doc .doc-dispute-underline { stroke: var(--ck-amber); opacity: 0; transition: opacity 400ms ease-out; }

/* Document stage modifiers */
.pd-chase-doc[data-stage="under-review"] .doc-line { opacity: 0.4; }
.pd-chase-doc[data-stage="disputed"]    .doc-line,
.pd-chase-doc[data-stage="negotiating"] .doc-line { opacity: 0.4; }
.pd-chase-doc[data-stage="under-review"] .doc-stroke { stroke: var(--ck-orange); }
.pd-chase-doc[data-stage="disputed"]    .doc-stroke,
.pd-chase-doc[data-stage="negotiating"] .doc-stroke { stroke: var(--ck-amber); }
.pd-chase-doc[data-stage="disputed"]    .doc-dispute-underline,
.pd-chase-doc[data-stage="negotiating"] .doc-dispute-underline { opacity: 0.9; }
.pd-chase-doc[data-stage="negotiating"] { animation: pd-chase-doc-pulse 1.4s ease-in-out infinite; }
@keyframes pd-chase-doc-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(216,146,51,0)); }
  50%      { filter: drop-shadow(0 0 6px rgba(216,146,51,0.4)); }
}
.pd-chase-doc[data-stage="approved"] .doc-line { stroke: var(--ck-green); opacity: 0.5; }
.pd-chase-doc[data-stage="approved"] .doc-stroke { stroke: var(--ck-green); }
.pd-chase-doc[data-stage="approved"] { filter: drop-shadow(0 0 18px var(--ck-green-glow)); }

/* Document arrival pulse — fires on adjuster handoff (step 3 of the chain).
   Stroke keyframes tween directly between status colors (no detour through ink),
   so the outline reads as continuous progress rather than a reset-and-rewrite.
   pulse-3 has no stroke keyframe: amber → amber is a no-op, data-stage carries it. */
.pd-chase-doc.arrival-pulse { animation: pd-chase-doc-arrival-scale 400ms ease-out; }
.pd-chase-doc.arrival-pulse.pulse-1 .doc-stroke { animation: pd-chase-doc-stroke-1 400ms ease-out forwards; }
.pd-chase-doc.arrival-pulse.pulse-2 .doc-stroke { animation: pd-chase-doc-stroke-2 400ms ease-out forwards; }
.pd-chase-doc.arrival-pulse.pulse-4 .doc-stroke { animation: pd-chase-doc-stroke-4 400ms ease-out forwards; }
.pd-chase-doc.arrival-pulse .doc-line { animation: pd-chase-doc-line-brighten 400ms ease-out; }
@keyframes pd-chase-doc-arrival-scale {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes pd-chase-doc-stroke-1 {
  0%   { stroke: var(--ck-ink-1); }
  100% { stroke: var(--ck-orange); }
}
@keyframes pd-chase-doc-stroke-2 {
  0%   { stroke: var(--ck-orange); }
  100% { stroke: var(--ck-amber); }
}
@keyframes pd-chase-doc-stroke-4 {
  0%   { stroke: var(--ck-amber); }
  100% { stroke: var(--ck-green); }
}
@keyframes pd-chase-doc-line-brighten {
  0%, 100% { opacity: var(--doc-line-base, 0.3); }
  50%      { opacity: calc(var(--doc-line-base, 0.3) + 0.2); }
}
/* Per-stage base opacity for the line-brighten keyframe (used during pulse). */
.pd-chase-doc                            { --doc-line-base: 0.3; }
.pd-chase-doc[data-stage="under-review"] { --doc-line-base: 0.4; }
.pd-chase-doc[data-stage="disputed"]     { --doc-line-base: 0.4; }
.pd-chase-doc[data-stage="negotiating"]  { --doc-line-base: 0.4; }
.pd-chase-doc[data-stage="approved"]     { --doc-line-base: 0.5; }

/* Status pill */
.pd-chase-status-pill {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 400ms ease-out, color 400ms ease-out;
  background: rgba(140, 132, 121, 0.12);
  color: var(--ck-ink-3);
}
.pd-chase-status-pill[data-stage="under-review"] { background: rgba(228, 100, 37, 0.12); color: var(--ck-orange-deep); }
.pd-chase-status-pill[data-stage="disputed"]     { background: rgba(216, 146, 51, 0.18); color: var(--ck-amber); }
.pd-chase-status-pill[data-stage="negotiating"]  { background: rgba(216, 146, 51, 0.24); color: var(--ck-amber); }
.pd-chase-status-pill[data-stage="approved"]     { background: rgba(74, 155, 126, 0.18); color: var(--ck-green); }

/* Approval check on doc */
.pd-chase-approve-check {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ck-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity 200ms ease-out;
  box-shadow: 0 2px 6px rgba(74,155,126,0.45);
}
.pd-chase-approve-check svg { width: 22px; height: 22px; display: block; }
.pd-chase-doc[data-stage="approved"] .pd-chase-approve-check { animation: pd-chase-check-pop 460ms cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes pd-chase-check-pop {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* Approval flash */
.pd-chase-approve-flash {
  position: absolute;
  top: 50%; left: 50%;
  width: 148px; height: 148px;
  border-radius: 50%;
  background: var(--ck-green);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  pointer-events: none;
  filter: blur(4px);
}
.pd-chase-doc.approving .pd-chase-approve-flash { animation: pd-chase-flash 700ms ease-out; }
@keyframes pd-chase-flash {
  0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.2); }
}

/* Doc launch + incoming */
.pd-chase-doc.launching { animation: pd-chase-launch 1000ms cubic-bezier(0.4, 0, 1, 0.5) forwards; }
@keyframes pd-chase-launch {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  40%  { opacity: 1; }
  100% { transform: translateY(-220px) scale(0.7); opacity: 0; }
}
.pd-chase-doc.incoming { animation: pd-chase-doc-in 500ms ease-out; }
@keyframes pd-chase-doc-in {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============== LABELS ============== */
/* Absolute-positioned so the icon remains the cluster's vertical center. */
.pd-chase-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}
.pd-chase-label-main { font-family: var(--font-body); font-weight: 600; font-size: 15px; color: var(--ck-ink-1); letter-spacing: -0.005em; }
.pd-chase-label-sub  { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--ck-ink-2); }

/* ============== ORBS ============== */
.pd-chase-orbs { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: visible; }
.pd-chase-orb {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: var(--ck-orange);
  box-shadow: 0 0 24px rgba(228,100,37,0.4), 0 1px 2px rgba(0,0,0,0.1);
  border: 2.5px solid #fff;
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
}
.pd-chase-orb[data-tone="amber"] {
  background: var(--ck-amber);
  box-shadow: 0 0 24px rgba(216,146,51,0.45), 0 1px 2px rgba(0,0,0,0.1);
}
.pd-chase-orb svg { width: 22px; height: 22px; display: block; }
.pd-chase-orb-trail {
  position: absolute;
  width: 32px; height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, rgba(228,100,37,0) 0%, rgba(228,100,37,0.45) 100%);
  transform: translate(-110%, -50%);
  filter: blur(2px);
  pointer-events: none;
}
.pd-chase-orb[data-tone="amber"] .pd-chase-orb-trail {
  background: linear-gradient(to right, rgba(216,146,51,0) 0%, rgba(216,146,51,0.55) 100%);
}

/* ============== REDUCED MOTION ============== */
@media (prefers-reduced-motion: reduce) {
  .pd-chase *, .pd-chase *::before, .pd-chase *::after {
    animation: none !important;
    transition: none !important;
  }
  .pd-chase-doc { filter: drop-shadow(0 0 18px var(--ck-green-glow)) !important; }
  .pd-chase-doc .doc-stroke { stroke: var(--ck-green) !important; }
  .pd-chase-doc .doc-line   { stroke: var(--ck-green) !important; opacity: 0.5 !important; }
  .pd-chase-status-pill { background: rgba(74, 155, 126, 0.18) !important; color: var(--ck-green) !important; }
  .pd-chase-approve-check { opacity: 1 !important; transform: scale(1) !important; }
}


/* ===================================================
   PILLAR 3 — CUSTOMERS (10 tickets, panel switching)
   Left: customer cards. Right: per-card conversation
   panel; one is-active at a time. Card 1 is live.
   =================================================== */

.pd-customers .pd-canvas.pd-customers-canvas {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

/* --- Header --- */
.pc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--pd-border);
  flex-shrink: 0;
}
.pc-eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pd-fg-sec);
  margin-bottom: 5px;
}
.pc-header-primary {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--pd-fg);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.pc-header-sub {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--pd-fg-sec);
  margin-top: 2px;
  line-height: 1.35;
}
.pc-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}
.pc-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--pd-accent);
  box-shadow: 0 0 0 0 rgba(var(--pd-accent-rgb), 0.45);
  animation: pd-pulse 1.8s infinite ease-out;
  flex-shrink: 0;
}
.pc-live-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.pc-live-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--pd-fg);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.pc-live-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--pd-fg-sec);
  letter-spacing: 0.05em;
}

/* --- Two-column body --- */
.pc-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
  padding: 16px 22px;
  min-height: 0;
}
.pc-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.pc-col-list { min-height: 0; }
.pc-col-chat { min-height: 0; }
.pc-col-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pd-fg-sec);
  margin-bottom: 8px;
}

/* --- Customer cards --- */
.pc-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.14) transparent;
  padding-right: 14px;
}
.pc-cards::-webkit-scrollbar { width: 5px; }
.pc-cards::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 999px; }

.pc-card {
  position: relative;
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: 8px;
  padding: 9px 28px 9px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  flex-shrink: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.pc-card[data-stage="pickedup"] { opacity: 0.62; }
.pc-card.is-selected {
  background: rgba(46, 139, 87, 0.06);
  border-color: rgba(46, 139, 87, 0.35);
  opacity: 1;
}

.pc-card-live {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: var(--pd-accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  line-height: 1.2;
}
.pc-card-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  animation: pd-pulse 1.4s infinite ease-out;
}

.pc-card-pulse {
  position: absolute;
  right: 11px;
  bottom: 11px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--pd-accent);
  box-shadow: 0 0 0 0 rgba(var(--pd-accent-rgb), 0.45);
  opacity: 0;
}
.pc-card.is-live .pc-card-pulse,
.pc-card.is-selected.is-live .pc-card-pulse {
  opacity: 1;
  animation: pd-pulse 1.8s infinite ease-out;
}

.pc-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.15;
  margin-top: 2px;
  white-space: nowrap;
}
.pc-pill[data-stage="new"]       { background: #DDEEDF; color: #2E6B3D; }
.pc-pill[data-stage="booked"]    { background: var(--pd-accent); color: #fff; }
.pc-pill[data-stage="estimate"]  { background: #E2ECF5; color: #345876; }
.pc-pill[data-stage="followup"]  { background: #F4E5C9; color: #885315; }
.pc-pill[data-stage="recovered"] { background: #C7EAD2; color: #1F6034; }
.pc-pill[data-stage="inrepair"]  { background: #DEE0E4; color: #4B5159; }
.pc-pill[data-stage="pickedup"]  { background: #E6E4DE; color: #7E7770; }

.pc-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.pc-card-time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--pd-fg-sec);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  text-transform: uppercase;
}
.pc-card-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--pd-fg);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.pc-card-sub {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--pd-fg-sec);
  line-height: 1.35;
}

/* --- Right column: panels (one is-active at a time) --- */
.pc-panels {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.pc-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.pc-panel.is-active {
  display: flex;
  animation: pc-fade-in 250ms ease-out both;
}
@keyframes pc-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pc-chat-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pd-border);
}
.pc-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--pd-fg);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.pc-chat-status .pc-live-dot { width: 7px; height: 7px; }
.pc-chat-header.is-live .pc-chat-status {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10.5px;
}
.pc-chat-sub {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--pd-fg-sec);
  padding-left: 14px;
}

.pc-transcript-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 10.5px;
  color: #888;
  margin: -4px 0 8px 14px;
}

.pc-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.14) transparent;
  padding-right: 14px;
}
.pc-thread::-webkit-scrollbar { width: 5px; }
.pc-thread::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 999px; }

.pc-bubble {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 88%;
}
.pc-bubble-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pd-fg-sec);
  font-weight: 500;
}
.pc-speaking-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--pd-accent);
  box-shadow: 0 0 0 0 rgba(var(--pd-accent-rgb), 0.55);
  animation: pd-pulse 1.4s infinite ease-out;
}
.pc-bubble-body {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--pd-fg);
  line-height: 1.45;
  padding: 9px 12px;
  border-radius: 12px;
  letter-spacing: -0.005em;
}

.pc-bubble-parrot {
  align-self: flex-start;
  align-items: flex-start;
}
.pc-bubble-parrot .pc-bubble-body {
  background: rgba(46, 139, 87, 0.12);
  color: var(--pd-fg);
}
.pc-bubble-customer {
  align-self: flex-end;
  align-items: flex-end;
}
.pc-bubble-customer .pc-bubble-body {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
}

.pc-bubble-voicemail,
.pc-bubble-system {
  align-self: stretch;
  align-items: center;
}
.pc-bubble-voicemail .pc-bubble-body,
.pc-bubble-system .pc-bubble-body {
  background: transparent;
  border: 1px dashed var(--pd-border);
  color: var(--pd-fg-sec);
  font-style: italic;
  font-size: 11px;
  padding: 8px 12px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.pc-bubble-system .pc-bubble-body { font-style: normal; text-align: left; }
.pc-bubble-system .pc-bubble-body strong {
  font-weight: 600;
  color: var(--pd-fg);
  font-style: normal;
}

.pc-status-pill {
  align-self: stretch;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--pd-fg);
  background: rgba(46, 139, 87, 0.1);
  border: 1px solid rgba(46, 139, 87, 0.28);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
  letter-spacing: -0.005em;
}

.pc-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 12px;
  margin-top: -4px;
}
.pc-typing-parrot {
  background: rgba(46, 139, 87, 0.12);
  align-self: flex-start;
}
.pc-typing-customer {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  align-self: flex-end;
}
.pc-typing span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--pd-accent);
  opacity: 0.55;
  animation: pc-typing 1.2s infinite ease-in-out;
}
.pc-typing-customer span { background: var(--pd-fg-sec); }
.pc-typing span:nth-child(2) { animation-delay: 0.18s; }
.pc-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes pc-typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-3px); }
}

/* --- Footer --- */
.pc-footer {
  padding: 13px 22px 15px;
  border-top: 1px solid var(--pd-border);
  text-align: center;
  flex-shrink: 0;
  background: var(--pd-bg);
}
.pc-footer-primary {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--pd-fg);
  letter-spacing: -0.005em;
}
.pc-footer-primary em {
  font-style: normal;
  color: var(--pd-accent);
  font-weight: 600;
}
.pc-footer-sub {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--pd-fg-sec);
  margin-top: 3px;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 980px) {
  .pd-canvas { padding: 22px; aspect-ratio: auto; }
  .pd-parts .pd-canvas.pd-parts-canvas { aspect-ratio: auto; }
  .pd-parts-grid { grid-template-columns: 1fr; gap: 18px; }
  .pd-parts-suppliers { max-height: none; mask-image: none; -webkit-mask-image: none; overflow: visible; }
  .pd-parts-cart { max-height: 460px; }
  .pd-parts-footer { flex-direction: column; align-items: stretch; }
  .pd-parts-footer-cta { width: 100%; }
  .pc-grid,
  .is-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .pd-timeline { gap: 6px; }
  .pd-scale { text-align: left; }
}
