/* Chart Controls — mini buttons, chart type menu, coin button/panel, indicator button/legend, pane legend */

.mini-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 80ms, background 80ms;
}

.mini-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.mini-btn:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.97);
}

.mini-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.chart-type-menu {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 4px 0;
  min-width: 140px;
}

.chart-type-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.chart-type-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.chart-type-menu-item.active {
  color: #fff;
  font-weight: 600;
}

.mini-btn.mode-btn {
  color: var(--blue);
  background: rgba(78, 140, 255, 0.1);
  font-weight: 600;
  border-radius: 6px;
}

.mini-btn.mode-btn:hover {
  background: rgba(78, 140, 255, 0.18);
}

.mini-btn.settings-btn {
  font-size: 14px;
  padding: 0 6px;
}

.chart-coin-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-coin-btn:hover { background: rgba(255,255,255,0.06); }

.chart-coin-panel {
  position: fixed;
  z-index: 200;
  width: 420px;
  max-height: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-indicator-shell {
  position: relative;
  flex: 0 0 auto;
  z-index: 14;
}

.chart-indicator-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #eef2f7;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}

.chart-indicator-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.pane-legend-bar {
  position: absolute;
  top: 4px;
  left: 6px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  pointer-events: auto;
}

.pane-legend-bar-overlay { position: relative; top: auto; left: auto; margin-bottom: 1px; }

.pane-overlay-legend-host {
  position: absolute; top: 4px; left: 6px; z-index: 10;
  display: flex; flex-direction: column; gap: 1px;
  pointer-events: auto;
}

.pane-legend-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 2px;
}

.pane-legend-value {
  font-weight: 500;
}

.pane-legend-btn {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 80ms, background 80ms;
}

.pane-legend-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}
