/* Stage tuner knob — aligned with dental chart light clinical studio theme */

.stage-knob-zone {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 1002;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0 0.5rem 0.5rem;
}

.stage-knob {
  position: relative;
  width: 188px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem 0.75rem;
  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);
  overflow: visible;
}

.stage-knob__title {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 0.6875rem;
  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__dial {
  position: relative;
  width: 180px;
  height: 130px;
  overflow: visible;
  margin-bottom: 0.45rem;
}

.stage-knob__svg {
  display: block;
  width: 180px;
  height: 130px;
  touch-action: none;
  position: relative;
  z-index: 0;
  overflow: visible;
}

.stage-knob__arc-track {
  fill: none;
  stroke: #dde5ef;
  stroke-width: 7;
  stroke-linecap: round;
}

.stage-knob__arc-progress {
  fill: none;
  stroke: url(#stage-knob-arc-gradient);
  stroke-width: 7;
  stroke-linecap: round;
}

.stage-knob__tick {
  stroke: var(--dc-text-muted, #7c8aa1);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.55;
}

.stage-knob__tick--dense {
  stroke-width: 1;
  opacity: 0.38;
}

.stage-knob__bead-hit {
  fill: transparent;
  cursor: grab;
}

.stage-knob__bead-hit:active {
  cursor: grabbing;
}

.stage-knob__bead {
  fill: #ffffff;
  stroke: var(--dc-mint, #00c2a8);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 6px rgba(0, 194, 168, 0.28));
  pointer-events: none;
}

.stage-knob__stage-bubble {
  fill: #ffffff;
  stroke: rgba(47, 124, 255, 0.35);
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 8px rgba(47, 124, 255, 0.28));
  pointer-events: none;
}

.stage-knob__stage-bubble-text {
  fill: var(--dc-blue, #2f7cff);
  font-size: 11px;
  font-weight: 750;
  font-family: var(--dc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.stage-knob__arc-label {
  fill: var(--dc-text-muted, #7c8aa1);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  font-family: var(--dc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif);
  text-anchor: middle;
}

.stage-knob__arc-label--end {
  font-size: 9px;
  fill: var(--dc-text-soft, #3c4a60);
}

.stage-knob__center {
  position: absolute;
  left: 50%;
  top: 66.15%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.35rem;
  border: 1px solid var(--dc-border, #e2e9f2);
  border-radius: 50%;
  background: var(--dc-surface, #ffffff);
  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;
  box-sizing: border-box;
}

.stage-knob__center-label {
  font-size: 0.4375rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dc-text-muted, #7c8aa1);
  line-height: 1;
}

.stage-knob__counts {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.05rem 0;
}

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

.stage-knob__count-value {
  font-size: 1rem;
  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 {
  pointer-events: auto;
  margin-top: 0.05rem;
  padding: 0.2rem 0.6rem;
  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__transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding-top: 0.15rem;
  border-top: 1px solid #eef2f8;
}

.stage-knob__transport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  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.25rem;
  height: 2.25rem;
  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: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage-knob__transport-btn--play svg {
  width: 16px;
  height: 16px;
  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);
}
