/* Chart Stage — container, chart host, canvas, cursor states, price range overlay, empty state, statusbar, tooltip */

.chart-stage {
  position: relative;
  min-height: 0;
  padding: 0 0 0 var(--chart-dock-width);
  background: var(--panel);
  overflow: hidden;
}

.chart-dock-status {
  align-self: end;
  display: grid;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #dce4ee;
  font-size: 10px;
  line-height: 1.45;
}

.chart-dock-status strong {
  font-size: 10px;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.chart-dock-status span {
  color: var(--muted);
}

.chart-host {
  position: absolute;
  inset: 0 0 0 var(--chart-dock-width);
  cursor: crosshair;
}

.chart-price-range-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.chart-price-range-item {
  position: absolute;
  pointer-events: none;
}

.chart-price-range-fill {
  position: absolute;
  inset: 0;
  background: rgba(214, 219, 228, 0.20);
}

.chart-price-range-top,

.chart-price-range-bottom,

.chart-price-range-center {
  position: absolute;
  background: rgba(244, 247, 252, 0.96);
  border-radius: 999px;
}

.chart-price-range-top,

.chart-price-range-bottom {
  left: 0;
  width: 100%;
  height: 2px;
}

.chart-price-range-top {
  top: 0;
}

.chart-price-range-bottom {
  bottom: 0;
}

.chart-price-range-center {
  top: 0;
  bottom: 0;
  width: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.chart-price-range-arrow {
  position: absolute;
  left: 50%;
  width: 34px;
  height: 22px;
  transform: translateX(-50%);
  overflow: visible;
}

.chart-price-range-arrow.down {
  bottom: -1px;
}

.chart-price-range-arrow.up {
  top: -1px;
}

.chart-price-range-arrow svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-price-range-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-width: max-content;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(41, 44, 51, 0.94);
  color: rgba(245, 248, 255, 0.96);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.chart-host.tool-create-mode {
  cursor: crosshair;
}

.chart-host.dragging {
  cursor: grabbing;
}

.chart-host.drawing-dragging {
  cursor: grabbing;
}

.chart-empty {
  position: absolute;
  inset: 0 0 0 var(--chart-dock-width);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.chart-empty.visible {
  display: flex;
}

.chart-statusbar {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(100% - 24px, 900px);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c9d0db;
  font-family: var(--mono);
  font-size: 11px;
  backdrop-filter: blur(10px);
}

.chart-statusbar strong {
  color: #eef2f7;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chart-status-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #dfe6ef;
  white-space: nowrap;
}

.chart-status-chip.ok {
  border-color: rgba(47, 180, 99, 0.40);
  background: rgba(47, 180, 99, 0.14);
  color: #b9f0cb;
}

.chart-status-chip.warn {
  border-color: rgba(245, 184, 61, 0.42);
  background: rgba(245, 184, 61, 0.12);
  color: #ffe1a0;
}

.chart-status-chip.pending {
  border-color: rgba(78, 140, 255, 0.38);
  background: rgba(78, 140, 255, 0.14);
  color: #c9daff;
}

.chart-status-chip.danger {
  border-color: rgba(255, 93, 115, 0.42);
  background: rgba(255, 93, 115, 0.14);
  color: #ffc5ce;
}

.chart-status-chip.muted {
  color: #c9d0db;
}

.chart-tooltip {
  position: absolute;
  z-index: 1;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
