/* Raptor Trade - Responsive v4 (ADITIVO + sidebar hamburger).
   DESKTOP (rt-desktop): SEM regra = INTOCADO. */

/* ==================== RESET html/body/root MOBILE ==================== */
body.rt-mobile,
body.rt-mobile #root,
body.rt-tablet,
body.rt-tablet #root {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-width: 0 !important;
  -webkit-text-size-adjust: 100%;
}

/* ==================== SIDEBAR MOBILE: HIDDEN + SLIDE-IN ==================== */
body.rt-mobile aside.h-full {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  width: 240px !important;
  z-index: 999 !important;
  background: rgba(15, 15, 22, 0.98) !important;
  backdrop-filter: blur(10px);
  transform: translateX(-100%) !important;
  transition: transform 0.3s ease-out !important;
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}

body.rt-mobile aside.h-full.rt-open {
  transform: translateX(0) !important;
}

/* Expandir labels mesmo com w-16 (mobile mostra full menu) */
body.rt-mobile aside.h-full .overflow-hidden {
  width: auto !important;
  opacity: 1 !important;
}

/* Garantir conteudo principal ocupa 100vw */
body.rt-mobile .h-screen.flex.flex-col,
body.rt-mobile .h-screen.flex.flex-col.overflow-hidden {
  width: 100vw !important;
  max-width: 100vw !important;
}

body.rt-mobile .flex-1.flex {
  width: 100vw !important;
  max-width: 100vw !important;
}

body.rt-mobile .flex-1.flex.flex-col {
  width: 100vw !important;
  max-width: 100vw !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* ==================== HIDE MASCOTE ==================== */
body.rt-mobile .raptor-mascot,
body.rt-mobile img[alt*="Raptor mascot"],
body.rt-mobile img[src*="mascot"] {
  display: none !important;
}

/* Em tablet, reduz mascote */
body.rt-tablet .raptor-mascot {
  width: 120px !important;
  height: 120px !important;
  opacity: 0.6;
}

/* ==================== HEADER mobile ==================== */
body.rt-mobile .vrd-hdr {
  display: grid !important;
  grid-template-columns: 48px 1fr auto !important;
  padding: 4px 8px !important;
  gap: 6px !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: auto !important;
  min-height: 48px;
}

body.rt-mobile .vrd-hdr > * {
  min-width: 0 !important;
  font-size: 11px !important;
}

body.rt-mobile .vrd-brand {
  padding-left: 50px !important; /* espaco pro hamburger */
  font-size: 12px !important;
  width: auto !important;
}

body.rt-mobile .vrd-tickbar {
  overflow-x: auto !important;
  scrollbar-width: none;
  font-size: 11px !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.rt-mobile .vrd-tickbar::-webkit-scrollbar {
  display: none;
}

body.rt-mobile .vrd-hdr-right {
  font-size: 11px !important;
}

/* ==================== SCROLL RELEASE GLOBAL ==================== */
body.rt-mobile .h-screen,
body.rt-tablet .h-screen,
body.rt-mobile .h-screen.overflow-hidden,
body.rt-tablet .h-screen.overflow-hidden,
body.rt-mobile .flex-1.flex.overflow-hidden,
body.rt-tablet .flex-1.flex.overflow-hidden,
body.rt-mobile .flex-1.flex.flex-col.overflow-hidden,
body.rt-tablet .flex-1.flex.flex-col.overflow-hidden {
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
}

/* ==================== VRD GRID ==================== */
body.rt-mobile .vrd-grid,
body.rt-tablet .vrd-grid {
  height: auto !important;
  min-height: 100vh;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto !important;
  overflow: visible !important;
  width: 100vw !important;
  max-width: 100vw !important;
}

body.rt-mobile .vrd-terminal,
body.rt-tablet .vrd-terminal {
  overflow: visible !important;
  width: 100vw !important;
  max-width: 100vw !important;
}

body.rt-mobile .vrd-col,
body.rt-tablet .vrd-col {
  overflow: visible !important;
  max-height: none !important;
  max-width: 100vw !important;
  width: 100% !important;
  padding: 6px !important;
  font-size: 11px !important;
}

body.rt-mobile [class*="vrd-"],
body.rt-tablet [class*="vrd-"] {
  max-width: 100vw !important;
}

/* ==================== VRD BODY: 1 COLUNA MOBILE ==================== */
body.rt-mobile .vrd-body {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto !important;
  overflow: visible !important;
  padding: 6px !important;
  gap: 6px !important;
  width: 100vw !important;
  max-width: 100vw !important;
}

/* Ordem mobile: chart topo, depois meio, depois RAPTOR FORCE */
body.rt-mobile .vrd-body > .vrd-col:nth-child(1) { order: 3 !important; }
body.rt-mobile .vrd-body > .vrd-col:nth-child(2) { order: 2 !important; }
body.rt-mobile .vrd-chart-col {
  order: 1 !important;
  min-height: 40vh !important;
  width: 100% !important;
  padding: 0 !important;
}

/* ==================== PAINEIS COMPACTOS ==================== */
body.rt-mobile [class*="grid-cols-2"],
body.rt-mobile [class*="grid-cols-3"],
body.rt-mobile [class*="grid-cols-4"] {
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
}

body.rt-mobile [style*="grid-template-columns"] {
  grid-template-columns: 1fr !important;
}

body.rt-mobile .grid:not(.vrd-body):not(.vrd-hdr):not(.vrd-grid) {
  grid-template-columns: 1fr !important;
}

body.rt-mobile .vrd-chart-col canvas,
body.rt-mobile .vrd-chart-col > div {
  width: 100% !important;
  max-width: 100% !important;
}

body.rt-mobile [class*="MACRO"],
body.rt-mobile [class*="MICRO"],
body.rt-mobile [class*="RAPTOR"] {
  width: 100% !important;
  max-width: 100% !important;
}

body.rt-mobile [class*="rounded"] {
  max-width: 100% !important;
}

body.rt-mobile .vrd-col * {
  word-break: break-word;
  overflow-wrap: break-word;
}

body.rt-mobile div[class*="col"][style*="grid"] {
  grid-template-columns: 1fr !important;
}

/* ==================== TABLET ==================== */
body.rt-tablet .vrd-body {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  padding: 8px !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100vw !important;
}

body.rt-tablet .vrd-chart-col {
  grid-column: 1 / -1 !important;
  order: -1 !important;
  min-height: 42vh !important;
  width: 100% !important;
}

body.rt-tablet .vrd-hdr {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
}

body.rt-tablet .vrd-hdr > * { min-width: 0 !important; }

body.rt-tablet .grid:not(.vrd-body):not(.vrd-hdr):not(.vrd-grid) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* ==================== TYPOGRAPHY MOBILE ==================== */
body.rt-mobile h1, body.rt-mobile h2 { font-size: 1rem !important; }
body.rt-mobile .text-lg, body.rt-mobile .text-xl { font-size: 0.9rem !important; }
body.rt-mobile .text-2xl, body.rt-mobile .text-3xl { font-size: 1.1rem !important; }
body.rt-mobile button, body.rt-mobile a { min-height: 32px; }

body.rt-mobile .vrd-col * {
  font-size: inherit;
}

body.rt-mobile img, body.rt-mobile svg { max-width: 100%; height: auto; }

/* Body scroll lock quando sidebar aberto */
body.rt-mobile.rt-sidebar-open {
  overflow: hidden !important;
}


/* ==================== v4.1: HIDE FLOATING PANELS NO MOBILE ==================== */

/* Painel RAPTOR SCALPER flutuante (position:fixed do overlay v170/v172) */
body.rt-mobile #__rt_curva_panel_v170,
body.rt-mobile #__rt_scalper_panel_v172,
body.rt-mobile [id*="__rt_curva_panel"],
body.rt-mobile [id*="__rt_scalper_panel"] {
  display: none !important;
  visibility: hidden !important;
}

/* Badges fixed do scalper */
body.rt-mobile #__rt_scalper_badge_v151,
body.rt-mobile [id*="__rt_scalper_badge"] {
  display: none !important;
}

/* SVGs overlay no chart: garantir que NAO extrapolam */
body.rt-mobile #__rt_scalper_svg_v151,
body.rt-mobile #__rt_curva_svg_v170,
body.rt-mobile #__rt_ma150_svg,
body.rt-mobile [id*="__rt_scalper_svg"],
body.rt-mobile [id*="__rt_curva_svg"],
body.rt-mobile [id*="__rt_ma"] {
  max-width: 100vw !important;
  pointer-events: none;
}

/* Em TABLET, painel scalper pode aparecer mas inline (nao fixed) */
body.rt-tablet #__rt_curva_panel_v170,
body.rt-tablet #__rt_scalper_panel_v172,
body.rt-tablet [id*="__rt_curva_panel"],
body.rt-tablet [id*="__rt_scalper_panel"] {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  margin: 8px 0 !important;
}

/* Hide voice overlay floating panels mobile (se houver) */
body.rt-mobile [id*="__rt_voice"],
body.rt-mobile [id*="voice-panel"] {
  display: none !important;
}

/* Hide watchdog overlay badge mobile */
body.rt-mobile [id*="__rt_watchdog"] {
  /* manter mas reposicionar */
  top: 60px !important;
  right: 6px !important;
  left: auto !important;
  width: auto !important;
  max-width: 140px !important;
  font-size: 10px !important;
  padding: 4px 8px !important;
}

/* Hide hot path overlay badge mobile (deixar discreto) */
body.rt-mobile [id*="__rt_hotpath"],
body.rt-mobile [id*="__rtHotPath"] {
  bottom: 6px !important;
  right: 6px !important;
  font-size: 9px !important;
  padding: 3px 6px !important;
  max-width: 100px !important;
}
