/* Current KCPC chart chrome. The historical-regime explorer is retired. */
.cp-live-toggle,
.cp-native[role="dialog"],
svg.cp-native-overlay {
  display: none !important;
}

/* The legacy experiment prompt used a fixed bottom position and collided with
 * the time axis and KCPC footer. Keep its live-region semantics for assistive
 * technology without painting it over the chart. */
.market-candle .hw-status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.market-candle .market-candle-meta {
  min-width: 0;
}

/* Keep the display control discoverable without drawing a box over the chart. */
.kcpc-n25-display-toggle {
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  height: 20px !important;
  margin: 0 0 0 8px !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: rgb(165, 211, 198) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  white-space: nowrap !important;
  font-size: 0 !important;
  line-height: 1 !important;
  appearance: none !important;
}

.kcpc-n25-display-toggle::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: rgb(77, 226, 185);
  box-shadow: 0 0 5px rgba(77, 226, 185, .68);
}

.kcpc-n25-display-toggle::after {
  content: 'KCPC';
  color: inherit;
  font: 650 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .035em;
}

.kcpc-n25-display-toggle[aria-pressed="false"] {
  color: rgb(122, 134, 140) !important;
}

.kcpc-n25-display-toggle[aria-pressed="false"]::before {
  background: rgb(105, 116, 121);
  box-shadow: none;
}

.kcpc-n25-display-toggle:hover::after { color: rgb(217, 244, 237); }
.kcpc-n25-display-toggle:focus-visible {
  outline: 1px solid rgb(165, 211, 198) !important;
  outline-offset: 3px !important;
}

/* Pulse only nodes selected by the persistent KCPC program journal. */
.kcpc-n36-program-chain {
  display: none;
}

.kcpc-n36-program-chain-target {
  opacity: 0;
  pointer-events: none;
}

.kcpc-n36-program-chain-target.kcpc-n27-chain-current {
  opacity: 1;
}

.kcpc-n36-program-chain-target path {
  fill: none;
  stroke: rgb(116, 226, 211);
  stroke-width: 2.8;
}

.kcpc-n36-program-chain-target circle {
  fill: rgb(8, 15, 17);
  stroke: rgb(116, 226, 211);
  stroke-width: 2.2;
}

.kcpc-n36-program-chain-target[data-program-transition="REVISE"] path,
.kcpc-n36-program-chain-target[data-program-transition="REVISE"] circle {
  stroke: rgb(255, 190, 92);
}

/* A RETRACT is drawn from its immutable journal snapshot.  The dashed red
 * tombstone marks removed geometry; it never revives it as a live structure. */
.kcpc-n36-program-chain-target[data-program-transition="RETRACT"] path {
  stroke: rgb(255, 104, 119);
  stroke-dasharray: 6 5;
}

.kcpc-n36-program-chain-target[data-program-transition="RETRACT"] circle {
  fill: transparent;
  stroke: rgb(255, 104, 119);
  stroke-dasharray: 3 2;
}

.kcpc-n16-reference.kcpc-n27-chain-current path {
  animation: kcpc-n27-reference-pulse .52s ease-out both;
}

.kcpc-n16-reference.kcpc-n27-chain-current .kcpc-n16-anchor,
.kcpc-n16-event.kcpc-n27-chain-current,
.kcpc-n36-program-chain-target.kcpc-n27-chain-current circle {
  animation: kcpc-n27-node-pulse .52s ease-out both;
  transform-box: fill-box;
  transform-origin: center;
}

.kcpc-n36-program-chain-target.kcpc-n27-chain-current path {
  animation: kcpc-n27-reference-pulse .52s ease-out both;
}

.kcpc-n36-program-chain-target[data-program-transition="RETRACT"].kcpc-n27-chain-current {
  animation: kcpc-n36-tombstone-pulse .52s ease-out both;
}

@keyframes kcpc-n27-reference-pulse {
  0% { opacity: .28; filter: none; }
  38% { opacity: 1; filter: drop-shadow(0 0 4px currentColor); stroke-width: 3.2; }
  100% { opacity: .82; filter: none; }
}

@keyframes kcpc-n27-node-pulse {
  0% { opacity: .35; transform: scale(.72); }
  45% { opacity: 1; transform: scale(1.85); filter: drop-shadow(0 0 5px currentColor); }
  100% { opacity: .92; transform: scale(1); filter: none; }
}

@keyframes kcpc-n36-tombstone-pulse {
  0% { opacity: .18; }
  42% { opacity: 1; filter: drop-shadow(0 0 5px rgba(255, 104, 119, .82)); }
  100% { opacity: .78; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .kcpc-n16-reference.kcpc-n27-chain-current path,
  .kcpc-n16-reference.kcpc-n27-chain-current .kcpc-n16-anchor,
  .kcpc-n16-event.kcpc-n27-chain-current,
  .kcpc-n36-program-chain-target.kcpc-n27-chain-current,
  .kcpc-n36-program-chain-target.kcpc-n27-chain-current path,
  .kcpc-n36-program-chain-target.kcpc-n27-chain-current circle {
    animation: none !important;
  }
}
