/* @import lives FIRST so the browser actually honours it. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

/* === SHARED WIDGET CHROME (scoped) === */

/* ============ Tokens — scoped to the widget ============ */
.sift-rca-derive{
  --sift-orange:        #F04A01;
  --sift-orange-bright: #FF5722;
  --sift-orange-deep:   #EE4120;
  --rubber-black:       #1B1D1F;
  --vanta:              #000000;
  --steel:              #726E6E;
  --titanium:           #E1D7D0;
  --ceramic:            #EEEFEC;
  --lunar:              #848582;

  --gray-100: #111111;
  --gray-90:  #222222;
  --gray-80:  #353534;
  --gray-70:  #4B4C4A;
  --gray-60:  #6A6B68;
  --gray-50:  #848582;
  --gray-40:  #9E9F9C;
  --gray-30:  #BABAB6;
  --gray-20:  #D4D4D0;
  --gray-10:  #EEEFEC;

  /* Channels — telemetry plot lines. Shared across all three RCA animations
     so the same channel reads the same color from panel to panel. */
  --ch-red:    #FA4D56;
  --ch-orange: #F89E37;
  --ch-blue:   #4589FF;
  --ch-cyan:   #33B1FF;
  --ch-mint:   #4ED49B;
  --ch-purple: #BE95FF;
  --ch-yellow: #FCC539;
  --ch-derived: #4ED49B;

  --rec-red: #E62325;

  /* Syntax token colors. */
  --tok-var: #FFAB70;
  --tok-num: #79B8FF;
  --tok-op:  #F97583;
}.sift-rca-derive, .sift-rca-derive *, .sift-rca-derive *::before, .sift-rca-derive *::after{ box-sizing: border-box; }

/* ============ Demo stage (shared) ============
   Dark canvas every RCA animation draws onto. */
.sift-rca-derive.demo-stage{
  background: #131416;
  border: 1px solid #2A2C2E;
  border-radius: 0;
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  overflow: hidden;
  color: var(--ceramic);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  container-type: inline-size;
}
.sift-rca-derive.demo-stage::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center center;
  pointer-events: none;
}

/* Generic clip transition wrapper — fades content groups in/out. */
.sift-rca-derive .clip{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 480ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .clip.in{
  opacity: 1;
  pointer-events: auto;
}

/* Axes — used by every plot SVG. */
.sift-rca-derive .axis-tick{
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  fill: var(--gray-50);
  letter-spacing: 0.06em;
}
.sift-rca-derive .axis-time{
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  fill: var(--gray-40);
  letter-spacing: 0.04em;
}
.sift-rca-derive .axis-line{ stroke: #2A2C2E; stroke-width: 1; }
.sift-rca-derive .grid-line{ stroke: rgba(255, 255, 255, 0.04); stroke-width: 1; }

/* ============ Demo cursor ============ */
.sift-rca-derive .cursor{
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  opacity: 0;
  z-index: 50;
  pointer-events: none;
  transition: transform 760ms cubic-bezier(0.2,0,0,1),
              opacity 280ms ease-out;
}
.sift-rca-derive .cursor.fast{
  transition: transform 420ms cubic-bezier(0.2,0,0,1),
              opacity 220ms ease-out;
}
/* Synced-scrub mode used by Sync — cursor tracks the playhead in lockstep
   with the hairline + event-log scroll. No transform transition means the
   React state update lands on the same paint as the hairline + table. */
.sift-rca-derive .cursor.synced{
  transition: transform 0ms linear,
              opacity 220ms ease-out;
}
.sift-rca-derive .cursor.visible{ opacity: 1; }
.sift-rca-derive .cursor-icon{
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.55));
}
.sift-rca-derive .cursor-icon.arrow{
  width: 44px; height: 44px;
  top: -9.625px;
  left: -13.75px;
  display: block;
  transform-origin: 13.75px 9.625px;
}
.sift-rca-derive .cursor.clicking .cursor-icon.arrow{
  animation: sift-rca-derive-cursor-click 220ms cubic-bezier(0.2, 0, 0, 1);
}@keyframes sift-rca-derive-cursor-click {
  0%   { transform: scale(1); }
  45%  { transform: scale(0.82); }
  100% { transform: scale(1); }
}

/* Build-in fade utility — used by every animation to introduce elements
   top-to-bottom one phase at a time. */
.sift-rca-derive .bi{
  opacity: 0;
  transition: opacity 360ms cubic-bezier(0.2, 0, 0, 1);
}
.sift-rca-derive .bi-in{ opacity: 1; }

/* Annotation tab — used by the Compare animation for the divergence marker.
   White mono ink on solid orange, rotated 90° CW by the JSX. */
.sift-rca-derive .anno-tab-rect{ fill: var(--sift-orange); }
.sift-rca-derive .anno-tab-text{
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.02em;
  fill: #FFFFFF;
  font-weight: 500;
}
.sift-rca-derive .anno-pop-host{
  animation: sift-rca-derive-anno-pop 280ms cubic-bezier(0.2,0,0,1);
}@keyframes sift-rca-derive-anno-pop {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
.sift-rca-derive .anno-tab-host{
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: sift-rca-derive-tab-pop 320ms cubic-bezier(0.2,0,0,1);
}@keyframes sift-rca-derive-tab-pop {
  0%   { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

/* Plot legend strip — square swatches, mono caps. */
.sift-rca-derive .plot-legend{
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gray-40);
}
.sift-rca-derive .plot-legend .ch-key{
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.sift-rca-derive .plot-legend .swatch{
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: 0 0 auto;
}

/* === PER-ANIMATION STYLES === */
/* =======================================================================
   Root Cause Analysis — Derive (calculated channel) animation — styles.

   Every selector scoped under `.sift-rca-derive`. The bundle's JS mounts a
   <div class="sift-rca-derive demo-stage">…</div> root, so nothing here can leak to
   the host page or be overridden unless the host scopes under `.sift-rca-derive`.

   The host page needs to:
     1. Provide an element with id="rca-derive-root" for React to mount into.
     2. Load React 18 + ReactDOM 18 BEFORE RootCauseAnalysis_Derive.js.
     3. Load IBM Plex Sans + IBM Plex Mono (imported below via Google Fonts).

   No other dependencies. No shared CSS. No other animation files referenced.
   ======================================================================= */

/* === rca-anim-2.css ============================================
   Animation 2 — Calculated channels (three-clip narrative).
   Depends on shared chrome from Root Cause Analysis.html.

   Layout vocab matches Animation 1: square corners, tab-style titles
   above data containers, HTML axis labels (fixed pixel size, not
   stretched), and the Sift palette throughout.
   ================================================================= */

/* ---------- Clip 1: oversized "+ New Calculated Channel" button ----------
   Same scale + chrome vocabulary as the Make-a-Rule intro button. Centered
   in the stage, big enough to fill the stage's optical centre. */
.sift-rca-derive .r2-intro-btn{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 18px)) scale(1.04);
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 24px 38px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #2A2C2E;
  color: var(--ceramic);
  border: 2px solid var(--steel);
  border-radius: 0;
  cursor: pointer;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 480ms cubic-bezier(0.2,0,0,1),
              transform 620ms cubic-bezier(0.2,0,0,1),
              background 140ms cubic-bezier(0.2,0,0,1),
              color 140ms cubic-bezier(0.2,0,0,1),
              border-color 140ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-intro-btn.show{
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.sift-rca-derive .r2-intro-btn.hover{
  background: #4B4C4A;
  color: var(--ceramic);
  border-color: #8E8A89;
}
.sift-rca-derive .r2-intro-btn.pressed{
  transform: translate(-50%, calc(-50% + 2px)) scale(0.99);
}
.sift-rca-derive .r2-intro-btn.gone{
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
  pointer-events: none;
  transition: opacity 420ms cubic-bezier(0.2,0,0,1),
              transform 460ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-intro-btn-plus{
  font-size: 28px;
  line-height: 1;
  color: var(--sift-orange);
  font-weight: 600;
}

/* ---------- Clip 2: form card ---------- */
.sift-rca-derive .r2-card{
  position: absolute;
  top: 50%; left: 50%;
  width: min(440px, calc(100% - 96px));
  background: var(--rubber-black);
  color: var(--ceramic);
  border: 1px solid #2A2C2E;
  border-radius: 0;
  padding: 18px 20px 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3;
  /* Card "zooms out" into view once the intro button is clicked. */
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-50% + 6px)) scale(1.06);
  transition: opacity 420ms cubic-bezier(0.2,0,0,1),
              transform 580ms cubic-bezier(0.2,0,0,1);
  pointer-events: none;
}
.sift-rca-derive .r2-card.in{
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.sift-rca-derive .r2-card.in.out,
.sift-rca-derive .r2-card.out{
  opacity: 0;
  transform: translate(-50%, calc(-50% + 4px)) scale(0.98);
  visibility: hidden;
  pointer-events: none;
}

.sift-rca-derive .r2-card-eyebrow{
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lunar);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sift-rca-derive .r2-card-pip{
  width: 6px;
  height: 6px;
  background: var(--sift-orange);
  border-radius: 999px;
  flex: 0 0 auto;
}

.sift-rca-derive .r2-field{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sift-rca-derive .r2-field-label{
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lunar);
}

/* Text input */
.sift-rca-derive .r2-input{
  position: relative;
  height: 30px;
  padding: 0 10px;
  background: #131416;
  border: 1px solid #2A2C2E;
  border-radius: 0;
  display: flex;
  align-items: center;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--ceramic);
  transition: border 140ms cubic-bezier(0.2,0,0,1),
              background 140ms cubic-bezier(0.2,0,0,1);
  overflow: hidden;
}
.sift-rca-derive .r2-input.mono{
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.sift-rca-derive .r2-input.focused{
  border-color: var(--sift-orange);
  background: #0E0F11;
}
.sift-rca-derive .r2-input-text{
  display: inline-block;
  white-space: nowrap;
}
.sift-rca-derive .r2-input-placeholder{
  /* Field-label-as-placeholder — same subtle grey as the dropdown
     placeholders, sized to match the input's typography. */
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--gray-60);
  pointer-events: none;
  white-space: nowrap;
}
.sift-rca-derive .r2-input.mono .r2-input-placeholder{
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.sift-rca-derive .r2-caret{
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--ceramic);
  margin-left: 1px;
  vertical-align: -2px;
  animation: sift-rca-derive-r2-caret-blink 800ms steps(2) infinite;
}@keyframes sift-rca-derive-r2-caret-blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0; }
}

/* Token colors — same scheme as Make-a-Rule. */
.sift-rca-derive .r2-tok-var{ color: var(--tok-var); }
.sift-rca-derive .r2-tok-num{ color: var(--tok-num); }
.sift-rca-derive .r2-tok-op{ color: var(--tok-op);  }
.sift-rca-derive .r2-tok-txt{ color: var(--ceramic); }
.sift-rca-derive .r2-tok-sp{ white-space: pre; }

/* Select (dropdown trigger) — same height + chrome as text input. */
.sift-rca-derive .r2-dropdown-wrap{
  position: relative;
}
.sift-rca-derive .r2-select{
  position: relative;
  min-height: 30px;
  padding: 4px 28px 4px 10px;
  background: #131416;
  border: 1px solid #2A2C2E;
  border-radius: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: border 140ms cubic-bezier(0.2,0,0,1),
              background 140ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-select.open{
  border-color: var(--sift-orange);
  background: #0E0F11;
}
.sift-rca-derive .r2-select.multi{
  /* Multi-select sits a touch taller to accommodate chips. */
  min-height: 32px;
  align-items: center;
}
.sift-rca-derive .r2-select-val{
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--ceramic);
}
.sift-rca-derive .r2-select-placeholder{
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--gray-60);
}
.sift-rca-derive .r2-select-chev{
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gray-50);
  transform: translateY(-50%);
  transition: transform 160ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-select.open .r2-select-chev{
  transform: translateY(-50%) rotate(180deg);
}

/* Chips inside the multi-select trigger. */
.sift-rca-derive .r2-select-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.sift-rca-derive .r2-chip{
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--ceramic);
  background: #2A2C2E;
  border: 1px solid #3A3B38;
  border-radius: 0;
  white-space: nowrap;
}

/* Dropdown menu — opens below the trigger. */
.sift-rca-derive .r2-dropdown{
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #1B1D1F;
  border: 1px solid #2A2C2E;
  border-radius: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  animation: sift-rca-derive-r2-dropdown-pop 180ms cubic-bezier(0.2,0,0,1);
}@keyframes sift-rca-derive-r2-dropdown-pop {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.sift-rca-derive .r2-dropdown-option{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12.5px;
  color: var(--gray-20);
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms cubic-bezier(0.2,0,0,1),
              color 120ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-dropdown-option.mono{
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.sift-rca-derive .r2-dropdown-option:hover{
  background: rgba(255,255,255,0.05);
  color: var(--ceramic);
}
.sift-rca-derive .r2-dropdown-option.selected{
  color: var(--ceramic);
}
.sift-rca-derive .r2-dropdown-check{
  width: 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--sift-orange);
}

/* CTA row */
.sift-rca-derive .r2-cta-row{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}
.sift-rca-derive .r2-cta{
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: #fff;
  background: var(--sift-orange);
  border: 1px solid var(--sift-orange);
  border-radius: 0;
  cursor: pointer;
  transition: filter 140ms cubic-bezier(0.2,0,0,1),
              transform 100ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-cta.hover{ filter: brightness(1.08); }
.sift-rca-derive .r2-cta.pressed{ transform: translateY(1px); }
.sift-rca-derive .r2-cta-ghost{
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-30);
  background: transparent;
  border: 1px solid #2A2C2E;
  border-radius: 0;
  cursor: pointer;
}

/* ---------- Clip 3: time-series plot ---------- */
.sift-rca-derive .r2-plot-clip{
  position: absolute;
  inset: 26px 56px 24px 56px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 480ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-plot-clip.in{
  opacity: 1;
  pointer-events: auto;
}
.sift-rca-derive .r2-plot-clip.out{
  opacity: 0;
  transition: opacity 480ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-plot-shell{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Tab title above the data container. Same vocabulary as Animation 1:
   sized to content, equal padding L/R, same fill as the data box, no
   bottom border so it visually attaches to the box below. */
.sift-rca-derive .r2-plot-head{
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #0E0F11;
  border-top: 1px solid #2A2C2E;
  border-left: 1px solid #2A2C2E;
  border-right: 1px solid #2A2C2E;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.sift-rca-derive .r2-plot-name{
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-30);
  white-space: nowrap;
}

/* Data container — square corners, dark fill, holds the SVG plot. */
.sift-rca-derive .r2-plot-body{
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #0E0F11;
  border: 1px solid #2A2C2E;
  overflow: hidden;
}
.sift-rca-derive .r2-plot-svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Y-tick HTML overlays (fixed pixel size, no SVG stretching). */
.sift-rca-derive .r2-y-ticks{
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  color: var(--gray-50);
  letter-spacing: 0.04em;
  line-height: 1;
  transition: transform 600ms cubic-bezier(0.2,0,0,1),
              opacity 480ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-y-ticks-left{
  left: 0;
  transform: translateX(0);
}
/* When the calc axis is shown, the source labels tuck in next to the
   divider — they shift right by their own width. */
.sift-rca-derive .r2-plot-body.calc-shown .r2-y-ticks-left{
  transform: translateX(100%);
}
.sift-rca-derive .r2-y-ticks-calc{
  /* Calc axis labels — left of the source axis, in white, only visible
     when the calculated channel is in the plot. */
  left: 0;
  color: var(--ceramic);
  opacity: 0;
}
.sift-rca-derive .r2-plot-body.calc-shown .r2-y-ticks-calc{
  opacity: 1;
}
.sift-rca-derive .r2-y-tick{
  position: absolute;
  transform: translateY(-50%);
  white-space: nowrap;
}
.sift-rca-derive .r2-y-ticks-left .r2-y-tick{ right: 5px; }
.sift-rca-derive .r2-y-ticks-calc .r2-y-tick{ right: 5px; }

/* Divider rule between the calc axis labels and the source axis labels.
   Sits at the right edge of the calc-axis column; fades in when the
   calc axis is shown. Spans only the plot area (between top and bottom
   plot padding) so it aligns with the source-axis frame lines instead
   of running edge-to-edge of the panel body. */
.sift-rca-derive .r2-axis-divider{
  position: absolute;
  top: 5.71%;    /* = PAD_T / SVG_H = 16 / 280 — matches the plot top */
  bottom: 10%;   /* = PAD_B / SVG_H = 28 / 280 — matches the plot baseline */
  width: 1px;
  background: #2A2C2E;
  pointer-events: none;
  opacity: 0;
  transition: opacity 480ms cubic-bezier(0.2,0,0,1);
  z-index: 2;
}
.sift-rca-derive .r2-plot-body.calc-shown .r2-axis-divider{
  opacity: 1;
}

/* Plot content group — every drawn thing (gridlines, frame lines,
   paths) lives inside this <g> so we can slide it as one unit when
   the calc axis appears on the left. translateX uses SVG user units
   (= 48 units, the calc axis width in viewBox space). */
.sift-rca-derive .r2-plot-svg .r2-plot-content{
  transform-origin: 0 0;
  transform-box: view-box;
  transition: transform 600ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-plot-body.calc-shown .r2-plot-svg .r2-plot-content{
  transform: translateX(48px);
}

/* Channel paths — draws revealed via stroke-dashoffset from JS. */
.sift-rca-derive .r2-src-path,
.sift-rca-derive .r2-der-path{
  fill: none;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.sift-rca-derive .r2-der-path{
  stroke: var(--ch-derived);
  stroke-width: 1.7;
}

/* Legend strip below the plot body. */
.sift-rca-derive .r2-plot-legend{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 2px 0;
  flex-shrink: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--gray-40);
}
.sift-rca-derive .r2-plot-legend .ch-key{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 280ms cubic-bezier(0.2,0,0,1),
              transform 280ms cubic-bezier(0.2,0,0,1);
}
.sift-rca-derive .r2-plot-legend .ch-key.show{
  opacity: 1;
  transform: translateY(0);
}
.sift-rca-derive .r2-plot-legend .swatch{
  width: 9px;
  height: 9px;
  border-radius: 0;
  flex: 0 0 auto;
}
.sift-rca-derive .r2-plot-legend .ch-key.derived{
  color: var(--ceramic);
}
