/* Treatment stage rail — full chart height, vertical stage dots */

.stage-knob-zone {
  position: relative;
  z-index: 2;
  flex: 0 0 7.25rem;
  width: 7.25rem;
  align-self: stretch;
  display: flex;
  pointer-events: none;
}

.stage-knob {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.55rem 0.65rem;
  border: 1px solid rgba(47, 124, 255, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 18px 50px rgba(47, 124, 255, 0.12),
    0 2px 8px rgba(28, 55, 90, 0.06);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--dc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif);
  box-sizing: border-box;
  overflow: hidden;
}

.stage-knob__title {
  margin: 0;
  width: 100%;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dc-mint-strong, #02a890);
}

.stage-knob--preview {
  border-color: rgba(47, 124, 255, 0.5);
  box-shadow:
    0 18px 50px rgba(47, 124, 255, 0.18),
    0 2px 8px rgba(28, 55, 90, 0.08);
}

.stage-knob--preview .stage-knob__title {
  color: var(--dc-blue, #2f7cff);
}

.stage-knob__meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.stage-knob__counts {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
}

.stage-knob__count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 1.85rem;
}

.stage-knob__count-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dc-text, #0f1b2d);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stage-knob__count-label {
  font-size: 0.4375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-text-muted, #7c8aa1);
}

.stage-knob__current {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--dc-border, #e2e9f2);
  border-radius: 999px;
  background: var(--dc-surface-2, #f6f9fd);
  color: var(--dc-text-soft, #3c4a60);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.stage-knob__current:hover {
  border-color: rgba(0, 194, 168, 0.45);
  background: #ffffff;
  color: var(--dc-mint-strong, #02a890);
}

.stage-knob__current--active {
  border-color: var(--dc-mint, #00c2a8);
  background: linear-gradient(135deg, var(--dc-mint-soft, rgba(0, 194, 168, 0.12)), var(--dc-blue-soft, rgba(47, 124, 255, 0.12)));
  color: var(--dc-mint-strong, #02a890);
  box-shadow: var(--dc-glow, 0 0 0 4px rgba(0, 194, 168, 0.14));
}

.stage-knob__stage-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 750;
  color: var(--dc-blue, #2f7cff);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Vertical stage track: equal slices, stage 1 at top → max at bottom */

.stage-knob__track {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: repeat(var(--stage-count, 1), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  padding: 0.15rem 0;
  overflow: hidden;
}

.stage-knob__track::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #dde5ef;
  pointer-events: none;
}

.stage-knob__dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 0.9rem;
  height: 0.9rem;
  padding: 0;
  border: 2px solid #c5d0de;
  border-radius: 50%;
  background: #e8eef5;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.stage-knob__dot:hover {
  transform: scale(1.15);
  border-color: rgba(47, 124, 255, 0.55);
}

.stage-knob__dot--reached {
  background: var(--dc-mint, #00c2a8);
  border-color: #02a890;
  box-shadow:
    0 0 0 3px rgba(0, 194, 168, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.stage-knob__dot--active {
  background: var(--dc-mint, #00c2a8);
  border-color: var(--dc-blue, #2f7cff);
  box-shadow:
    0 0 0 4px rgba(47, 124, 255, 0.2),
    0 4px 12px rgba(0, 194, 168, 0.28);
  transform: scale(1.2);
}

.stage-knob__dot--dense {
  width: 0.5rem;
  height: 0.5rem;
  border-width: 1.5px;
  box-shadow: none;
}

.stage-knob__transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  flex-shrink: 0;
  padding-top: 0.35rem;
  border-top: 1px solid #eef2f8;
}

.stage-knob__transport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--dc-border, #e2e9f2);
  border-radius: 50%;
  background: var(--dc-surface-2, #f6f9fd);
  color: var(--dc-text-soft, #3c4a60);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s, transform 0.15s;
  padding: 0;
}

.stage-knob__transport-btn:hover:not(:disabled) {
  border-color: rgba(0, 194, 168, 0.45);
  background: #ffffff;
  color: var(--dc-mint-strong, #02a890);
  box-shadow: 0 6px 16px rgba(0, 194, 168, 0.14);
  transform: translateY(-1px);
}

.stage-knob__transport-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.stage-knob__transport-btn--play {
  width: 2.1rem;
  height: 2.1rem;
  border-color: rgba(47, 124, 255, 0.35);
  background: rgba(47, 124, 255, 0.08);
  color: var(--dc-blue, #2f7cff);
}

.stage-knob__transport-btn--play:hover:not(:disabled) {
  border-color: var(--dc-blue, #2f7cff);
  background: rgba(47, 124, 255, 0.12);
  color: var(--dc-blue, #2f7cff);
  box-shadow: 0 6px 16px rgba(47, 124, 255, 0.18);
}

.stage-knob__transport-btn--playing {
  border-color: var(--dc-mint, #00c2a8);
  background: var(--dc-mint-soft, rgba(0, 194, 168, 0.12));
  color: var(--dc-mint-strong, #02a890);
  box-shadow: var(--dc-glow, 0 0 0 4px rgba(0, 194, 168, 0.14));
}

.stage-knob__transport-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage-knob__transport-btn--play svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}

/* Preview banner on chart */

.stage-preview-banner {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(47, 124, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--dc-text-soft, #3c4a60);
  letter-spacing: 0.02em;
  box-shadow: var(--dc-shadow-sm, 0 1px 2px rgba(15, 27, 45, 0.05), 0 2px 8px rgba(15, 27, 45, 0.04));
  pointer-events: none;
}

.stage-preview-banner[hidden] {
  display: none;
}

.stage-preview-banner__stage {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--dc-blue, #2f7cff);
}

@media (max-width: 1200px) {
  .stage-knob-zone {
    flex: none;
    width: 100%;
    height: auto;
    order: 3;
  }

  .stage-knob {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem 0.85rem;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0.65rem 0.85rem;
  }

  .stage-knob__title {
    width: auto;
    flex-shrink: 0;
    text-align: left;
  }

  .stage-knob__meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: auto;
    gap: 0.45rem 0.65rem;
  }

  .stage-knob__counts {
    width: auto;
    gap: 0.45rem;
  }

  /* Stage 1 at left → max at right */
  .stage-knob__track {
    flex: 1 1 12rem;
    min-width: 10rem;
    min-height: 2.25rem;
    width: auto;
    grid-template-rows: none;
    grid-template-columns: repeat(var(--stage-count, 1), minmax(0, 1fr));
    padding: 0 0.15rem;
  }

  .stage-knob__track::before {
    top: 50%;
    bottom: auto;
    left: 0.35rem;
    right: 0.35rem;
    width: auto;
    height: 2px;
    transform: translateY(-50%);
  }

  .stage-knob__transport {
    width: auto;
    padding-top: 0;
    padding-left: 0.55rem;
    border-top: none;
    border-left: 1px solid #eef2f8;
  }
}
