.node-button {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: grid;
  gap: 2px;
  width: clamp(146px, 13vw, 178px);
  height: auto;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #091220;
  color: var(--text);
  overflow: hidden;
  padding: 8px 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  text-align: left;
}

.stage-label {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 112px;
  max-width: 190px;
  border: 1px solid rgba(183, 203, 230, 0.14);
  border-radius: 999px;
  background: rgba(183, 203, 230, 0.06);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  padding: 6px 9px;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.node-button.active {
  border-color: rgba(73, 209, 255, 0.86);
  box-shadow: 0 0 0 2px rgba(73, 209, 255, 0.15);
}

.node-button.phase-hidden {
  display: none;
}

.node-button.context-only {
  opacity: 0.32;
}

.node-button.active-flow {
  opacity: 1;
}

.node-kicker {
  color: var(--muted);
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.08;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.node-label {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  overflow: visible;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.16;
  white-space: normal;
  word-break: normal;
}

.node-button.source {
  border-color: rgba(79, 139, 255, 0.35);
}

.node-button.destination {
  border-color: rgba(255, 107, 125, 0.48);
}

.node-button.holding {
  border-color: rgba(255, 191, 91, 0.58);
}

.node-button.sponsor {
  border-color: rgba(82, 224, 164, 0.5);
}

.hover-card {
  position: absolute;
  z-index: 4;
  max-width: 280px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(10, 18, 31, 0.96);
  box-shadow: var(--shadow);
  color: var(--soft);
  padding: 10px;
  font-size: 0.78rem;
  pointer-events: none;
}

.timeline svg {
  display: block;
  width: 100%;
  height: 100%;
}

.timeline text {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.timeline .axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.timeline .bar-old {
  fill: var(--blue);
}

.timeline .bar-new {
  fill: var(--red);
}

.timeline .bar-outgoing {
  fill: var(--amber);
}

.timeline .cursor {
  stroke: var(--green);
  stroke-width: 2;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.phase-old {
  background: rgba(79, 139, 255, 0.18);
  color: #bcd2ff;
}

.phase-new {
  background: rgba(255, 107, 125, 0.16);
  color: #ffc5cc;
}

.phase-out {
  background: rgba(255, 191, 91, 0.16);
  color: #ffdfa7;
}

.amount {
  color: var(--green);
  font-weight: 850;
}

.warn {
  color: var(--amber);
}

.small-note {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.source-list {
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}

.source-list a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .node-button {
    width: 112px;
    min-height: 42px;
    padding: 6px 7px;
  }

  .stage-label {
    min-width: 64px;
    max-width: 84px;
    font-size: 0.5rem;
    padding: 5px;
  }

  .node-label {
    font-size: 0.58rem;
    line-height: 1.12;
  }

  .node-kicker {
    font-size: 0.5rem;
  }
}
