/* Alertas no gráfico — linha tracejada + card na escala de preço (✕ encerra) */

.macro-trend-grid .mtg-chart-host,
.macro-trend-grid .mtg-expand-chart-host,
#mtg-expand-host,
.mt-cell-body,
#chart-host,
#chart-line-host,
#tp-ws-chart,
[data-tp-ws-chart] {
  overflow: visible;
}

/* TP workstation: não forçar position:relative (host é absolute fill). */
#chart-host,
#chart-line-host,
.mtg-chart-host,
[data-macro-chart],
.mt-cell-body,
[data-overview-slot] {
  position: relative;
}

/* Trading Plan · Alt+click alertas: não clipar chips na escala */
#ih-panel-trading-plan .tp-ws-chart-wrap,
#view-trading-plan .tp-ws-chart-wrap {
  overflow: visible;
}

#tp-ws-chart > .imperium-alert-overlay,
[data-tp-ws-chart] > .imperium-alert-overlay {
  z-index: 99990;
}

#chart-host > .imperium-alert-overlay,
#chart-line-host > .imperium-alert-overlay,
.mtg-chart-host > .imperium-alert-overlay,
[data-macro-chart] > .imperium-alert-overlay,
.mt-cell-body > .imperium-alert-overlay,
[data-overview-slot] > .imperium-alert-overlay,
#tp-ws-chart > .imperium-alert-overlay,
[data-tp-ws-chart] > .imperium-alert-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 99980;
}

/* legado: overlays antigos no body (removidos em runtime) */
body > .imperium-alert-overlay {
  display: none !important;
}

.imperium-alert-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.imperium-alert-overlay.ih-hidden {
  display: none !important;
}

.imperium-alert-lines {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.imperium-alert-labels {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.imperium-alert-labels .imperium-alert-chip {
  position: absolute;
  pointer-events: auto;
  z-index: 3;
  left: auto;
}

.imperium-alert-chip {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  min-width: 96px;
  max-width: 148px;
  height: 28px;
  pointer-events: auto;
  background: linear-gradient(180deg, #5a9fb0 0%, #4a8fa0 100%);
  border: 1px solid rgba(130, 198, 214, 0.72);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.78),
    0 2px 12px rgba(0, 0, 0, 0.48);
  font-family: var(--font-bloomberg, 'Bloomberg Prop Unicode N'), monospace;
  white-space: nowrap;
  isolation: isolate;
  cursor: default;
  user-select: none;
  box-sizing: border-box;
}

.imperium-alert-chip--overview-normal {
  min-width: 96px;
  max-width: 132px;
  height: 28px;
}

.imperium-alert-chip--overview-expanded {
  min-width: 100px;
  max-width: 140px;
  height: 28px;
}

.imperium-alert-labels--overview-lane {
  pointer-events: none;
}

.imperium-alert-labels--overview-lane .imperium-alert-chip {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.78),
    0 2px 10px rgba(0, 0, 0, 0.55);
}

.imperium-alert-chip--cpm-card,
.imperium-alert-chip--monitor-cell {
  min-width: 78px;
  max-width: 118px;
  height: 24px;
}

.imperium-alert-chip--cpm-card .imperium-alert-chip-flag,
.imperium-alert-chip--monitor-cell .imperium-alert-chip-flag {
  flex: 0 0 20px;
  width: 20px;
  height: 24px;
  font-size: 10px;
}

.imperium-alert-chip--cpm-card .imperium-alert-chip-px,
.imperium-alert-chip--monitor-cell .imperium-alert-chip-px {
  padding: 0 5px;
  font-size: 10px;
  line-height: 24px;
}

.imperium-alert-chip--cpm-card .imperium-alert-chip-close,
.imperium-alert-chip--monitor-cell .imperium-alert-chip-close {
  flex: 0 0 22px;
  width: 22px;
  height: 24px;
  font-size: 11px;
}

.imperium-alert-chip--cpm-expand {
  min-width: 98px;
  max-width: 142px;
  height: 28px;
}

.imperium-alert-chip-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 28px;
  color: #fff;
  font-size: 12px;
  border-right: 1px solid rgba(0, 0, 0, 0.22);
}

.imperium-alert-chip-px {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 28px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.imperium-alert-chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 28px;
  padding: 0;
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 0 2px 2px 0;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.imperium-alert-chip-close:hover {
  background: rgba(190, 45, 45, 0.94);
  color: #fff;
}

.imperium-alert-chip--hit {
  opacity: 0.82;
  filter: saturate(0.85);
  border-color: rgba(255, 210, 90, 0.6);
}

#chart-host.alert-mode {
  cursor: crosshair;
}
