/* ════════════════════════════════════════════════════════════════════
   SVG unlock timeline + its floating tooltip
   Visuals only — drawing logic lives in js/charts/timeline.js.
   ════════════════════════════════════════════════════════════════════ */

.svg-host { width: 100%; position: relative; }
.svg-host svg { display: block; width: 100%; height: auto; }

.timeline-row-bg     { fill: rgba(255,255,255,.02); }
.timeline-row-bg.alt { fill: rgba(255,255,255,.04); }
:root[data-theme="light"] .timeline-row-bg     { fill: rgba(0,0,0,.025); }
:root[data-theme="light"] .timeline-row-bg.alt { fill: rgba(0,0,0,.05); }

.timeline-label      { fill: var(--foreground);        font-size: 11px; font-weight: 500; font-family: var(--font-mono); }
.timeline-label.dim  { fill: var(--muted-foreground);  font-size: 10px; }

/* Token icon next to each row label. Painted by attachTimelineIcons in
 * js/charts/timeline.js. clip-path turns the SVG <image> rect into a
 * circle, matching the .ticker-icon visual contract used everywhere
 * else (Token DD's tdd-img-circle, ticker badges in tables). */
.timeline-icon { clip-path: circle(50% at 50% 50%); }
.timeline-axis-tick  { stroke: var(--border); stroke-width: 1; }
.timeline-axis-text  { fill: var(--muted-foreground); font-size: 10px; font-family: var(--font-mono); }

/* "Deal signed" reference glyph that anchors each row to the signing
   date — thin vertical tick + thin horizontal connector running into
   the first unlock circle (reads as "|-------O"). Muted so it doesn't
   compete with the colored span pill or the tranche markers. */
.timeline-deal-signed    { stroke: var(--muted-foreground); stroke-width: 1.25; opacity: .65; }
.timeline-deal-connector { stroke: var(--muted-foreground); stroke-width: 1;    opacity: .45; }

/* Vlines + zone shading mirror backtest sweep:
   today line   = white dashed, MtM-cutoff line = amber dashed [5,4]
   pre-discount = teal/cyan rgba (matches ZONE_CLIFF_FILL)
   post-discount = amber rgba (ZONE_VEST_FILL) */
.timeline-vline-today  { stroke: var(--foreground); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.timeline-vline-mtm    { stroke: var(--chart-3);    stroke-width: 1.5; stroke-dasharray: 5 4; }
.timeline-mtm-zone     { fill: rgba(78,205,196,.07); }
.timeline-disc-zone    { fill: rgba(244,162,97,.07); }

/* In-chart labels above the vertical reference lines */
.timeline-vline-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
}
.vline-label-today { fill: var(--foreground); opacity: .85; }
.vline-label-mtm   { fill: var(--chart-3); }

/* Generous hover for the unlock timeline:
   The row background <rect> is the ONLY element in the SVG that receives
   pointer events. Everything else is pointer-events:none so the cursor
   always reaches the row's nearest-tranche snap handler. */
.svg-host svg * { pointer-events: none; }
.svg-host .timeline-row-bg { pointer-events: all; cursor: crosshair; }

.timeline-circle {
  transition: r .15s ease, stroke-width .15s ease, filter .15s ease;
}
.timeline-circle.is-hover {
  r: 8;
  stroke: var(--foreground);
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(248,248,248,.45));
}

/* Floating tooltip for timeline.
   Mirrors the Chart.js tooltip styling on the charts above (popover bg,
   1px border, 4px radius, no drop shadow). Lives on <body> with
   position: fixed so it can lerp toward the cursor independently of the
   chart host's stacking context. JS handles positioning + easing. */
.timeline-tooltip {
  position: fixed; pointer-events: none; z-index: 50;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; font-size: 12px;
  /* Fixed width — was min/max 220/340, but the variable width caused
   * the tooltip to visibly resize between hovers (different deals have
   * different name lengths), which combined with the position lerp made
   * the box appear to "swipe" left-to-right between items. Locked at
   * 420px which fits every current deal name + ticker + signed-date
   * combo on a single line ("RIVER · RIVER_SABLIER · SIGNED 2026-01-05"
   * is the worst case at ~41 chars × 6.6px monospace + chrome). */
  width: 420px; box-sizing: border-box;
  opacity: 0; transition: opacity .12s ease;
  font-family: var(--font-mono);
  left: 0; top: 0;
}
.timeline-tooltip.show { opacity: 1; }
.timeline-tooltip .tt-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--foreground); margin-bottom: 6px;
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
  text-transform: uppercase; letter-spacing: .08em; font-size: 11px;
}
/* Pin the icon slot to a fixed 16×16 square from mount so the header
 * text starts at the same x-pixel on every render. flex-shrink:0 +
 * flex-grow:0 prevent the slot from being stretched by sibling-flex
 * rules (the header text below uses flex:1 1 auto to consume slack). */
.timeline-tooltip .tt-head-icon {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  margin: 0;
}
/* Target ONLY the text span, not the icon span. Previously this rule
 * matched both children of .tt-head and let the icon's own flex grow
 * to fill space, which surfaced as the "stretched icon" the user saw
 * on PARTI / RIVER tooltips. */
.timeline-tooltip .tt-head .tt-head-text {
  flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.timeline-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; margin: 2px 0; }
.timeline-tooltip .tt-row .k { color: var(--muted-foreground); }
.timeline-tooltip .tt-row .v { color: var(--foreground); }
.timeline-tooltip .tt-section {
  margin-top: 8px; padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 9px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted-foreground); font-weight: 600;
}
