/* FOCUS LEVELS — canto SE · card com borda · folga da escala de preço */
.chart-focus-levels {
  --cfl-fs: 0.98;
  position: absolute;
  right: 52px;
  bottom: 10px;
  left: auto;
  top: auto;
  z-index: 28;
  width: max-content;
  min-width: 248px;
  max-width: 330px;
  pointer-events: none;
  user-select: none;
  background: rgba(7, 10, 13, 0.96);
  border: 1px solid #2a3644;
  border-radius: 0;
  padding: 0;
  margin: 0;
  font-family: var(--inst-mono, var(--font-bloomberg), Consolas, monospace);
  font-variant-numeric: tabular-nums;
  color: #ebe5d8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transform-origin: bottom right;
}

/* Desk Terminal: acima do chart slot / BBG */
.imperium-desk-view .mt-cell-body .chart-focus-levels,
.imperium-desk-view .mtg-chart-host .chart-focus-levels {
  z-index: 40;
  max-width: min(330px, 92%);
}

/* MONITORING GRID · card FOCUS em todas as células (escala um pouco menor) */
#view-acompanhamento .mt-cell-body .chart-focus-levels {
  --cfl-fs: 0.86;
  max-width: min(300px, 88%);
  pointer-events: auto;
}

/* Trading Plan · card FOCUS no gráfico #tp-ws-chart (fontes um pouco menores) */
#tp-ws-chart > .chart-focus-levels,
[data-tp-ws-chart] > .chart-focus-levels,
#ih-panel-trading-plan .chart-focus-levels {
  --cfl-fs: 0.84;
  z-index: 36;
  max-width: min(300px, 90%);
}

.chart-focus-levels.ih-hidden {
  display: none !important;
}

/* ── Chip compacto (grid Terminal — célula pequena) ── */
.chart-focus-levels.cfl-chip {
  min-width: 0;
  max-width: none;
  width: max-content;
  background: rgba(7, 10, 13, 0.92);
  border: 1px solid #2a3644;
}

.chart-focus-levels .cfl-chip-btn {
  appearance: none;
  border: 0;
  background: transparent;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.3;
  color: #ebe5d8;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

.chart-focus-levels .cfl-chip-btn:hover .cfl-chip-title {
  color: #6fb2c0;
}

.chart-focus-levels .cfl-chip-title {
  color: #4a8fa0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-focus-levels .cfl-chip-pl {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-focus-levels .cfl-chip-lots {
  color: #8a96a0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Título clicável (recolher card → chip) no grid */
.chart-focus-levels .cfl-title-btn {
  appearance: none;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}

.chart-focus-levels .cfl-title-btn:hover {
  color: #6fb2c0;
}

.chart-focus-levels .cfl-hd,
.chart-focus-levels .cfl-row {
  display: grid;
  grid-template-columns: minmax(64px, auto) 40px 48px minmax(40px, auto) minmax(64px, 1fr);
  align-items: center;
  column-gap: 6px;
}

.chart-focus-levels .cfl-hd {
  padding: 6px 8px 5px;
  border-bottom: 1px solid #2a3644;
  color: #6a7884;
  font-size: calc(9px * var(--cfl-fs, 1));
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}

.chart-focus-levels .cfl-title {
  color: #4a8fa0;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-focus-levels .cfl-col {
  text-align: right;
  white-space: nowrap;
}

.chart-focus-levels .cfl-body {
  padding: 2px 0 4px;
}

.chart-focus-levels .cfl-row {
  padding: 6px 8px;
  font-size: calc(10px * var(--cfl-fs, 1));
  font-weight: 600;
  line-height: 1.25;
  border-bottom: 1px solid rgba(42, 54, 68, 0.85);
}

.chart-focus-levels .cfl-body > .cfl-row:last-child {
  border-bottom: none;
}

.chart-focus-levels .cfl-row--total,
.chart-focus-levels .cfl-row--openpl {
  border-top: 1px solid #2a3644;
  border-bottom: none;
  margin-top: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  color: #ebe5d8;
}

.chart-focus-levels .cfl-row--total {
  border-bottom: 1px solid rgba(42, 54, 68, 0.85);
}

.chart-focus-levels .cfl-asset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ebe5d8;
  font-size: calc(10px * var(--cfl-fs, 1));
  min-width: 0;
  white-space: nowrap;
}

.chart-focus-levels .cfl-asset-btn {
  appearance: none;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #ebe5d8;
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  border-radius: 0;
}

.chart-focus-levels .cfl-asset-btn:hover {
  color: #6fb2c0;
}

.chart-focus-levels .cfl-asset-btn:focus-visible {
  outline: 1px solid #4a8fa0;
  outline-offset: 1px;
}

.chart-focus-levels .cfl-bar {
  display: inline-block;
  width: 2px;
  height: 12px;
  background: #4a8fa0;
  border-radius: 0;
  flex: 0 0 auto;
}

.chart-focus-levels .cfl-row--total .cfl-bar,
.chart-focus-levels .cfl-row--openpl .cfl-bar {
  display: none;
}

.chart-focus-levels .cfl-lots,
.chart-focus-levels .cfl-risk,
.chart-focus-levels .cfl-glist {
  text-align: right;
  font-size: calc(10px * var(--cfl-fs, 1));
  white-space: nowrap;
  line-height: 1.25;
}

.chart-focus-levels .cfl-lots {
  color: #9aa7b2;
}

.chart-focus-levels .cfl-risk {
  color: #ebe5d8;
}

.chart-focus-levels .cfl-glist {
  color: #6fb2c0;
  font-size: calc(9px * var(--cfl-fs, 1));
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-focus-levels .cfl-pl,
.chart-focus-levels .cfl-openpl {
  text-align: right;
  font-size: calc(10px * var(--cfl-fs, 1));
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.25;
}

.chart-focus-levels .cfl-openpl {
  font-size: calc(11px * var(--cfl-fs, 1));
}

.chart-focus-levels .cfl-val--gain,
.chart-focus-levels .cfl-pl.cfl-val--gain,
.chart-focus-levels .cfl-openpl.cfl-val--gain {
  color: #67E6C9;
}

.chart-focus-levels .cfl-val--loss,
.chart-focus-levels .cfl-pl.cfl-val--loss,
.chart-focus-levels .cfl-openpl.cfl-val--loss {
  color: #E77A7A;
}
