/* MACRO REVERSAL RADAR — Reuters / Eikon · 3 modos: painel · 2× · overlay */
:root {
  --mrr-dock-h: 310px;
  --mrr-wide-h: 578px;
  --mrr-steel: #4A8FA0;
  --mrr-mint: #67E6C9;
  --mrr-cream: #ebe5d8;
  --mrr-dim: #6a7884;
  --mrr-line: #1a2430;
  --mrr-bg: #070a0d;
  --mrr-panel: #0a0e12;
}

#mrr-dock-slot {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}

#mrr-dock-slot:empty {
  display: none;
}

#macro-reversal-radar.mrr-card {
  box-sizing: border-box;
  background: var(--mrr-bg);
  border-radius: 0;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-bloomberg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#macro-reversal-radar.mrr-card.mrr-dock {
  position: relative;
  width: 100%;
  border: none;
  border-top: 1px solid var(--mrr-line);
  flex-shrink: 0;
}

#macro-reversal-radar.mrr-mode-dock {
  height: var(--mrr-dock-h);
}

#macro-reversal-radar.mrr-mode-wide {
  height: var(--mrr-wide-h);
}

#chart-host #macro-reversal-radar.mrr-mode-chart {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 55;
  border: none;
  box-shadow: none;
  background: var(--mrr-bg);
}

.mrr-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 4px;
  border-bottom: 1px solid var(--mrr-line);
  min-height: 0;
  background: var(--mrr-panel);
}

.mrr-header-title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-bloomberg);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.25;
  color: var(--mrr-steel);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.mrr-modebar {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  pointer-events: auto;
}

.mrr-mode-btn {
  font-family: var(--font-bloomberg);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  min-width: 22px;
  padding: 4px 5px;
  text-align: center;
  background: transparent;
  border: 1px solid var(--mrr-line);
  color: var(--mrr-dim);
  cursor: pointer;
  user-select: none;
  border-radius: 0;
}

.mrr-mode-btn:hover {
  color: var(--mrr-cream);
  border-color: rgba(74, 143, 160, 0.45);
}

.mrr-mode-btn.active {
  background: rgba(74, 143, 160, 0.12);
  border-color: rgba(74, 143, 160, 0.55);
  color: var(--mrr-steel);
}

.mrr-collapse-toggle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--mrr-line);
  border-radius: 0;
  background: transparent;
  color: var(--mrr-steel);
  font-family: var(--font-bloomberg);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.mrr-collapse-toggle:hover {
  background: rgba(74, 143, 160, 0.1);
  border-color: rgba(74, 143, 160, 0.45);
  color: var(--mrr-cream);
}

#macro-reversal-radar.mrr-collapsed.mrr-mode-dock,
#macro-reversal-radar.mrr-collapsed.mrr-mode-wide {
  height: auto;
  min-height: 0;
  max-height: none;
}

#macro-reversal-radar.mrr-collapsed .mrr-body,
#macro-reversal-radar.mrr-collapsed .mrr-tfbar,
#macro-reversal-radar.mrr-collapsed .mrr-cpm-bar {
  display: none;
}

#macro-reversal-radar.mrr-collapsed .mrr-header {
  border-bottom: none;
}

#macro-reversal-radar.mrr-mode-chart .mrr-header-title {
  font-size: 11px;
}

#macro-reversal-radar.mrr-mode-chart .mrr-mode-btn {
  font-size: 10px;
}

#macro-reversal-radar.mrr-mode-chart .mrr-tfbar {
  gap: 4px;
  padding: 5px 6px 6px;
}

#macro-reversal-radar.mrr-mode-chart .mrr-tf-btn {
  font-size: 12px;
  min-height: 30px;
  padding: 7px 0;
}

#macro-reversal-radar.mrr-mode-chart .mrr-tf-btn.active {
  font-weight: 700;
}

.mrr-tfbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 5px 6px 6px;
  border-top: 1px solid var(--mrr-line);
  background: var(--mrr-panel);
  pointer-events: auto;
  cursor: default;
}

.mrr-tf-btn {
  font-family: var(--font-bloomberg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.2;
  padding: 8px 0;
  min-height: 32px;
  border-radius: 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c1014;
  border: 1px solid var(--mrr-line);
  color: #a8b4c0;
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  box-shadow: none;
}

.mrr-tf-btn:hover {
  color: var(--mrr-cream);
  border-color: rgba(74, 143, 160, 0.5);
}

.mrr-tf-btn.active {
  background: var(--mrr-steel) !important;
  border-color: var(--mrr-steel) !important;
  color: #070a0d !important;
  font-weight: 700;
  box-shadow: none !important;
  text-shadow: none;
}

.mrr-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  pointer-events: auto;
  cursor: default;
  touch-action: none;
  background: #000000;
}

.mrr-body .mrr-chart,
.mrr-body .mrr-chart canvas {
  cursor: inherit;
}

.mrr-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mrr-legend {
  position: absolute;
  left: 6px;
  bottom: 4px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}

.mrr-leg {
  font-family: var(--font-bloomberg);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  opacity: 0.9;
}

.mrr-leg--9 { color: var(--mrr-ma9, #4A8FA0); }
.mrr-leg--50 { color: var(--mrr-ma50, #67E6C9); }
.mrr-leg--221 { color: var(--mrr-ma221, #8a9aab); }

.mrr-hint {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-family: var(--font-bloomberg);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(106, 120, 132, 0.55);
  pointer-events: none;
  z-index: 2;
  user-select: none;
  text-align: right;
  line-height: 1.25;
  max-width: 120px;
}

#macro-reversal-radar.mrr-mode-chart .mrr-hint {
  font-size: 9px;
  max-width: 170px;
}

.mrr-card.mrr--bull .mrr-header-title,
.mrr-card.mrr--bear .mrr-header-title {
  color: var(--mrr-steel);
}

body.view-geral-active #macro-reversal-radar.mrr-card.mrr-dock {
  background: var(--mrr-bg);
  border-top-color: var(--mrr-line);
}

body.view-geral-active #chart-host #macro-reversal-radar.mrr-mode-chart {
  background: var(--mrr-bg);
}

body.view-geral-active .mrr-header-title,
body.view-geral-active .mrr-leg,
body.view-geral-active .mrr-hint,
body.view-geral-active .mrr-tf-btn,
body.view-geral-active .mrr-mode-btn {
  font-family: var(--inst-mono, var(--font-bloomberg));
}

body.view-geral-active .mrr-header-title {
  color: var(--mrr-steel);
}

body.view-geral-active .mrr-tf-btn.active,
body.view-geral-active .mrr-mode-btn.active {
  background: var(--mrr-steel) !important;
  border-color: var(--mrr-steel) !important;
  color: #070a0d !important;
  box-shadow: none !important;
}

body.view-geral-active .mrr-mode-btn.active {
  background: rgba(74, 143, 160, 0.12) !important;
  color: var(--mrr-steel) !important;
}

body.view-geral-active .mrr-tf-btn {
  font-size: 13px;
  font-weight: 600;
  min-height: 32px;
  padding: 8px 0;
  border-radius: 0;
  background: #0c1014;
  border-color: var(--mrr-line);
  color: #a8b4c0;
}

body.view-geral-active .mrr-tf-btn:hover {
  color: var(--mrr-cream);
  border-color: rgba(74, 143, 160, 0.5);
}

body.view-geral-active #macro-reversal-radar.mrr-mode-chart .mrr-tf-btn {
  font-family: var(--inst-mono, var(--font-bloomberg));
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Geral · Alt+Q — gráfico fullscreen + watchlist/TV (Alt+X) + MRR à direita */
body.view-geral-active.fs-mode.fs-mrr-panel #app {
  grid-template-columns: minmax(0, 1fr) var(--right-w, 283px) !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel #center {
  grid-column: 1 !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel #right {
  display: flex !important;
  flex-direction: column;
  grid-column: 2 !important;
  min-width: var(--right-w, 283px) !important;
  width: var(--right-w, 283px) !important;
  overflow: hidden;
}

body.view-geral-active.fs-mode.fs-mrr-panel #right > :not(#mrr-dock-slot):not(#setup-log-panel):not(#wl-panel-default):not(#wl-tv-slot):not(#right-resize-handle):not(#overview-feed-slot) {
  display: none !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel #wl-panel-default {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #app {
  grid-template-columns: minmax(0, 1fr) calc(var(--right-w, 283px) * 2) !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #right {
  min-width: calc(var(--right-w, 283px) * 2) !important;
  width: calc(var(--right-w, 283px) * 2) !important;
  overflow-y: auto;
  overflow-x: hidden;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #wl-panel-default {
  display: none !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel #wl-tv-slot {
  display: none !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #wl-tv-slot {
  display: flex !important;
  flex: 0 0 auto;
  min-height: 0;
  min-width: 0;
}

body.view-geral-active.fs-mode.fs-mrr-panel.fs-oms-dock.gov-tv-wl-mode #app {
  grid-template-columns: var(--left-w) minmax(0, 1fr) calc(var(--right-w, 283px) * 2) !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel #mrr-dock-slot {
  display: flex !important;
  flex: 0 0 auto;
  width: 100%;
}

body.view-geral-active.fs-mode.fs-mrr-panel.mrr-layout-dock #mrr-dock-slot {
  flex-basis: var(--mrr-dock-h);
  min-height: var(--mrr-dock-h);
  max-height: var(--mrr-dock-h);
}

body.view-geral-active.fs-mode.fs-mrr-panel.mrr-layout-wide #mrr-dock-slot {
  flex-basis: var(--mrr-wide-h);
  min-height: var(--mrr-wide-h);
  max-height: var(--mrr-wide-h);
}

body.view-geral-active.fs-mode.fs-mrr-panel #macro-reversal-radar.mrr-card {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-height: none !important;
  border-top: 1px solid var(--mrr-line);
}

body.view-geral-active.fs-mode.fs-mrr-panel.mrr-layout-dock #macro-reversal-radar.mrr-mode-dock {
  height: var(--mrr-dock-h) !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.mrr-layout-wide #macro-reversal-radar.mrr-mode-wide {
  height: var(--mrr-wide-h) !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.fs-oms-dock #app {
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w, 283px) !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.fs-oms-dock #center {
  grid-column: 2 !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.fs-oms-dock #right {
  grid-column: 3 !important;
}

body.view-geral-active #macro-reversal-radar.mrr-mode-chart .mrr-tf-btn.active {
  font-weight: 700;
}

/* Bloomberg TV · watchlist — MRR preenche o restante; TF/CPM no rodapé do painel */
body.view-geral-active.gov-tv-wl-mode #right {
  overflow: hidden !important;
  min-height: 0;
}

body.view-geral-active.gov-tv-wl-mode #wl-tv-slot {
  flex: 0 0 auto !important;
  min-height: 0;
}

body.view-geral-active.gov-tv-wl-mode #mrr-dock-slot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

body.view-geral-active.gov-tv-wl-mode #macro-reversal-radar.mrr-card.mrr-dock {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
}

body.view-geral-active.gov-tv-wl-mode #macro-reversal-radar.mrr-mode-wide,
body.view-geral-active.gov-tv-wl-mode #macro-reversal-radar.mrr-mode-dock {
  height: 100% !important;
  min-height: 0;
}

body.view-geral-active.gov-tv-wl-mode #macro-reversal-radar .mrr-body {
  flex: 1 1 auto;
  min-height: 88px;
}

body.view-geral-active.gov-tv-wl-mode #macro-reversal-radar .mrr-tfbar,
body.view-geral-active.gov-tv-wl-mode #macro-reversal-radar .mrr-cpm-bar {
  flex: 0 0 auto;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #right {
  overflow: hidden !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #mrr-dock-slot {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode.mrr-layout-wide #mrr-dock-slot,
body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode.mrr-layout-dock #mrr-dock-slot {
  flex-basis: auto;
  min-height: 0;
  max-height: none;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode #macro-reversal-radar.mrr-card {
  height: 100% !important;
  max-height: none !important;
}

body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode.mrr-layout-wide #macro-reversal-radar.mrr-mode-wide,
body.view-geral-active.fs-mode.fs-mrr-panel.gov-tv-wl-mode.mrr-layout-dock #macro-reversal-radar.mrr-mode-dock {
  height: 100% !important;
}
