/* Paleta: base #0B0E11 (carbón), panel #12151A, línea #1E232B,
   acento señal #F0B90B (ámbar, referencia a tickers de futuros),
   alcista #26A69A, bajista #EF5350, texto #C7CCD1 */

:root {
  --bg: #0b0e11;
  --panel: #12151a;
  /* Fondo de las barras (superior, herramientas y lateral derecho): más negro
     que el panel, con un brillo tenue de arriba abajo. */
  --barra: #000000;
  --barra-brillo: #000000;   /* negro puro, el más intenso */
  --line: #1e232b;
  --text: #c7ccd1;
  --text-dim: #6b7280;
  --accent: #f0b90b;
  --bull: #26a69a;
  --bear: #ef5350;
  --mono: 'JetBrains Mono', 'Consolas', monospace;
  --sans: 'Inter', -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e2e5ea;
  --text: #1a1d23;
  --text-dim: #71767f;
  --accent: #b8860b;
  --bull: #0d9488;
  --bear: #dc2626;
}

body { transition: background 0.15s, color 0.15s; }

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Negro pleno, el mismo de las barras. Era el gris del body el que se veía
     por detrás de la franja de las horas. */
  background: #000000;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
}

/* ---- Barra superior ---- */
#topbar {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  /* Sin margen a la izquierda: el logo tiene que quedar pegado a la esquina.
     El hueco lo recupera el primer elemento después de la marca. */
  padding: 0 16px 0 0;
  border-bottom: 1px solid var(--line);
  background: var(--barra-brillo);
}

/* La línea de separación, dibujada por encima de los hijos de la barra: así
   cruza entera de lado a lado aunque el logo llegue hasta abajo. */
#topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

#topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
  font-size: 13px;
  white-space: nowrap;
  padding-right: 4px;
}
/* El logo llena el alto de la barra y arranca en el píxel 0. */
#topbar .brand .brand-logo {
  /* Cuadrado y con 'contain': el logo es cuadrado, así que cualquier caja que
     no lo sea lo recorta o lo aplasta. Un píxel menos de alto para que la línea
     de separación se vea entera por debajo. */
  width: 47px;
  height: 47px;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

#topbar select, #topbar input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}

#tfFavorites { display: flex; gap: 4px; }

/* ---- Buscador de par (símbolo) con lupa ---- */
.symbol-picker {
  position: relative;
  display: flex;
  align-items: center;
}
.symbol-picker-icon {
  position: absolute;
  left: 8px;
  font-size: 11px;
  opacity: 0.6;
  pointer-events: none;
}
#symbolSearchInput {
  width: 150px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 8px 6px 26px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}
#symbolSearchInput:focus { outline: none; border-color: var(--accent); }
#symbolDropdown {
  position: absolute;
  top: 32px;
  left: 0;
  /* Más ancho: ahora lleva precio, variación y porcentaje. */
  width: 400px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.symbol-option {
  /* Columnas fijas: logo, par, precio, variación, porcentaje y estrella. Así
     los números quedan alineados de una fila a otra. */
  display: grid;
  grid-template-columns: 24px 1fr 100px 70px 18px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.symbol-option .so-logo { display: flex; align-items: center; }
.symbol-option .so-logo .par-logo { margin-right: 0; }
.symbol-option .so-par { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.symbol-option .so-precio { text-align: right; }
.symbol-option .so-pct { text-align: right; font-size: 11px; color: var(--text-dim); }
.symbol-option .sube { color: #00c853; }
.symbol-option .baja { color: #e53935; }
.symbol-option:hover { background: rgba(240,185,11,0.12); }
.symbol-option.highlighted { background: rgba(240,185,11,0.2); }
.symbol-option .fav-star { color: var(--accent); }
.symbol-empty { padding: 10px; font-size: 12px; color: var(--text-dim); text-align: center; }
/* Letras y números de las temporalidades en blanco, activa o no. */
.tf-fav-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 6px 9px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
}
/* Letras y números de las temporalidades siempre en blanco; lo que cambia al
   estar activa es el borde y el fondo, no el color del texto. */
.tf-fav-btn, .tf-fav-btn.active, .tf-fav-btn:hover { color: #ffffff; }
.tf-fav-btn.active { border-color: var(--accent); background: rgba(240,185,11,0.08); }

#topbar .spacer { flex: 1; }

#priceTicker {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}
#priceTicker.up { color: var(--bull); }
#priceTicker.down { color: var(--bear); }

.btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  transition: border-color 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #0b0e11; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { opacity: 0.9; color: #0b0e11; }
.btn.danger:hover { border-color: var(--bear); color: var(--bear); }

/* ---- Layout principal ---- */
#main {
  display: flex;
  height: calc(100vh - 48px);
}

#chartPanel {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

#indicatorBar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  user-select: none;
}
.chip.active { color: var(--accent); border-color: var(--accent); }
.chip-label { cursor: pointer; }
.chip-gear {
  cursor: pointer;
  font-size: 12px;
  opacity: 0.6;
  padding: 2px 4px;
  border-radius: 50%;
}
.chip-gear:hover { opacity: 1; background: rgba(240,185,11,0.15); }

/* ---- Modal de configuración de indicador ---- */
#cfgModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cfg-box {
  width: 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  /* La caja nunca pasa del alto de la ventana. Lo que se desplaza es la lista
     de campos, así que los botones de abajo quedan siempre a la vista: en
     Estructura y en el Sniper había tantos campos que Aplicar quedaba fuera de
     la pantalla y no se podía pulsar. */
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
#cfgFields {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
  margin-right: -4px;
}
.cfg-footer { flex-shrink: 0; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.cfg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--accent);
}
.cfg-header #cfgClose { cursor: pointer; color: var(--text-dim); font-weight: 400; }
.cfg-header #cfgClose:hover { color: var(--text); }
.cfg-field { margin-bottom: 12px; }
.cfg-field label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.cfg-field input[type="number"], .cfg-field input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}
/* El campo de mensaje de las alertas: sin esto salía con el estilo por defecto
   del navegador y no se distinguía del fondo. */
.cfg-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 12px;
  resize: vertical;
  min-height: 46px;
}
.cfg-field textarea:focus { outline: none; border-color: var(--accent, #f0b90b); }

.cfg-field input[type="color"] {
  width: 100%;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px;
  cursor: pointer;
}
.cfg-footer {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.cfg-footer .btn { flex: 1; }

/* min-height: 0 es imprescindible. En una columna flex el tamaño mínimo por
   defecto es el del contenido, y el lienzo del gráfico tiene alto propio: sin
   esto el contenedor no cede y la columna se desborda, empujando los paneles
   de abajo (RSI, USDT.D) fuera de la pantalla. Se veían "activados" pero
   quedaban por debajo del borde inferior de la ventana. */
#chartContainer { flex: 1; position: relative; min-height: 0; }
/* Los paneles de abajo son hijos de un contenedor flex en columna. Con solo
   `height` el navegador los deja encoger cuando falta sitio, y el RSI acababa
   aplastado a unos 30px: se abría, pero no se veía nada dentro. Con `flex` se
   les reserva su alto y no ceden. */
#rsiContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); }
#rsiContainer.hidden, 

#liveIndicator {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

#smcCanvas {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 2;
}

#smcPanels {
  position: absolute;
  right: 12px;
  bottom: 12px;
  /* Por encima de la franja de paneles (z-index 3): Fuerza y Delta deben
     quedar delante del RSI y el Estocástico, no debajo. */
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.corner-table {
  background: rgba(13,17,23,0.92);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 150px;
  overflow: hidden;
}
[data-theme="light"] .corner-table { background: rgba(255,255,255,0.95); }
.corner-table .ct-header {
  padding: 6px 10px;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
}
.corner-table .ct-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
}
.corner-table .ct-row + .ct-row { border-top: 1px solid var(--line); }
.corner-table .ct-label { color: var(--text-dim); }
.corner-table .ct-value.buy { color: #00c853; }
.corner-table .ct-value.sell { color: var(--bear); }
.corner-table .ct-value.delta-pos { color: var(--bull); font-weight: 700; font-size: 14px; }
.corner-table .ct-value.delta-neg { color: var(--bear); font-weight: 700; font-size: 14px; }

/* ---- Barra de herramientas de dibujo ---- */
/* Fila: herramientas a la izquierda, gráfico y paneles a la derecha. */
#chartRow {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  min-width: 0;
}
#chartStack {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* Barra de herramientas en vertical, pegada al borde izquierdo. */
#drawToolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  /* Con los iconos al triple ya no caben todos de alto: la barra se desplaza. */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  border-right: 1px solid var(--line);
  border-bottom: none;
  background: #000000;
  flex: 0 0 auto;
}
#drawToolbar .draw-sep {
  width: 28px;
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}
.draw-btn {
  /* Iconos al doble: de 14 px de letra a 28. Fijo, sin ajuste que lo cambie. */
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  color: #8f959e;   /* trazos de los iconos: gris medio, sin llegar a blanco */
  font-size: 28px;
  line-height: 1;
  user-select: none;
}
.draw-btn:hover { background: rgba(240,185,11,0.12); color: #cfd3d8; }
.draw-btn.active { background: var(--accent); color: #0b0e11; }
.draw-sep { width: 1px; height: 26px; background: var(--line); margin: 0 6px; }

#drawCanvas {
  position: absolute;
  top: 0; left: 0;
  z-index: 4;
  pointer-events: none; /* por defecto no bloquea el pan/zoom del gráfico; se activa solo con una herramienta seleccionada */
  touch-action: none;   /* en el móvil, con una herramienta tomada, el dedo dibuja en vez de mover la página */
}
.ge-dibujos { touch-action: none; }

#volumeResizeHandle {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  margin-top: -4px;
  cursor: ns-resize;
  z-index: 5;
  background: transparent;
}
#volumeResizeHandle:hover, #volumeResizeHandle.dragging {
  background: rgba(240, 185, 11, 0.25);
}

/* Lateral estilo TradingView: tira de iconos pegada al borde derecho y panel
   que se despliega hacia la izquierda. En reposo solo ocupa el ancho de la
   tira, así el gráfico gana sitio. */
#sidebar {
  display: flex;
  flex-direction: row;
  background: transparent;
  border-left: none;
  width: 48px;
  transition: width .15s ease;
}
#sidebar.desplegado { width: 348px; }

/* Sin esto el panel del gráfico no puede encogerse: en flexbox el tamaño
   mínimo por defecto es el del contenido, y la barra de indicadores es ancha.
   El resultado era que al desplegar el lateral la fila se desbordaba en vez de
   dejarle sitio, y el gráfico quedaba tapado por el panel. */
#chartPanel { min-width: 0; min-height: 0; overflow: hidden; }

#rail {
  width: 48px;
  flex: 0 0 48px;
  border-left: 1px solid var(--line);
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 4px;
  order: 2;
}
.rail-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  opacity: 0.7;
}
.rail-btn:hover { background: var(--line); opacity: 1; }
.rail-btn.activo { background: var(--line); opacity: 1; box-shadow: inset 2px 0 0 var(--accent, #f0b90b); }
/* El icono del Asistente IA siempre con el tono de cuando se pasa el cursor:
   con el 70 % casi no se notaba. */
.rail-btn[data-panel="asistente"] { opacity: 1; }

#flyout {
  width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel);
  order: 1;
  display: flex;
  flex-direction: column;
}
#sidebar.desplegado #flyout { width: 300px; overflow-y: auto; }

/* Dentro del desplegable solo se ve el panel activo, y ya sin la flecha, que
   ahora no aporta nada: se cierra pulsando otra vez su icono o la cabecera. */
#flyout .panel { display: none; }
#flyout .panel.abierto { display: block; }
#flyout .panel-arrow { display: none; }

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.sidebar-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  border-bottom: 2px solid transparent;
}
.sidebar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.sidebar-content { flex: 1; overflow-y: auto; padding: 12px; display: none; }
.sidebar-content.active { display: block; }

.alert-item, .invite-item, .user-item {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}
.alert-item .row, .invite-item .row, .user-item .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
}
.tag.bull { background: rgba(38,166,154,0.15); color: var(--bull); }
.tag.bear { background: rgba(239,83,80,0.15); color: var(--bear); }
.tag.used { background: rgba(107,114,128,0.15); color: var(--text-dim); }
.tag.revoked { background: rgba(239,83,80,0.15); color: var(--bear); }

.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.form-group input, .form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---- Pantalla de login ---- */
#authScreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.auth-box {
  width: 340px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 28px;
}
/* Título y logo centrados en la pantalla de entrada. */
.auth-box h1 { text-align: center; }
.auth-box p.sub { text-align: center; }
.auth-box h1 {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 18px;
  margin: 0 0 4px;
}
.auth-box p.sub { color: var(--text-dim); font-size: 12px; margin: 0 0 20px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.auth-tabs .btn { flex: 1; }
.error-msg { color: var(--bear); font-size: 12px; margin-top: 8px; min-height: 16px; }

#toastContainer {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  padding: 10px 11px;
  border-radius: 4px;
  font-size: 12px;
  min-width: 220px;
  animation: slideIn 0.2s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.hidden { display: none !important; }

/* Recuadro del precio en vivo sobre la escala: precio arriba y cuenta atrás
   debajo, dentro de la misma caja. Sustituye a la etiqueta que dibuja la
   librería del gráfico (apagada con lastValueVisible: false). */
#priceBadge {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 0;
  border-radius: 2px;
  font-family: monospace;
  line-height: 1.1;
  color: #ffffff;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
#priceBadge.hidden { display: none; }
#priceBadge .pb-precio { font-size: 12px; font-weight: 700; }
#priceBadge .pb-cuenta { font-size: 11px; opacity: 0.9; }
#priceBadge.pb-urgente .pb-cuenta { font-weight: 700; opacity: 1; }

/* Menú del clic derecho sobre el gráfico */
#chartContextMenu {
  position: fixed;
  z-index: 999;
  background: #1b1f27;
  border: 1px solid #2a2e3d;
  border-radius: 6px;
  padding: 4px 0;
  min-width: 210px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.55);
}
#chartContextMenu.hidden { display: none; }
#chartContextMenu .ctx-item {
  padding: 8px 16px;
  font-size: 13px;
  color: #c7ccd1;
  cursor: pointer;
  user-select: none;
}
#chartContextMenu .ctx-item:hover { background: #262b35; color: #fff; }

/* ===== Buscador de pares: la lupa a la derecha ===== */
/* El icono va después del input en el HTML y posicionado a la derecha, para
   que no se solape con la primera letra de lo que se escribe. */
.symbol-picker { position: relative; }
.symbol-picker .symbol-picker-icon {
  position: absolute;
  /* Hay una regla anterior que fija left: 8px. Si se deja puesta, el navegador
     tiene el elemento sobre-restringido y en escritura de izquierda a derecha
     gana `left`, así que el icono seguía tapando la primera letra pese a pedir
     `right`. Anulándolo explícitamente, el icono se va a la derecha. */
  left: auto;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.55;
  font-size: 12px;
}
.symbol-picker #symbolSearchInput {
  padding-left: 8px;
  padding-right: 26px;
}

/* ===== Panel lateral por secciones plegables ===== */
.panel { border-bottom: 1px solid var(--line); }
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--text);
}
.panel-head:hover { background: rgba(255,255,255,0.035); }
.panel-ico { font-size: 15px; width: 18px; text-align: center; }
.panel-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-count {
  font-size: 10px;
  background: var(--line);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 1px 7px;
}
.panel-arrow { color: var(--text-dim); font-size: 11px; transition: transform 0.15s; }
.panel.abierto .panel-arrow { transform: rotate(90deg); }
.panel-body { display: none; padding: 4px 12px 14px; }
.panel.abierto .panel-body { display: block; }
.panel-vacio { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* ===== Perfil ===== */
.perfil-fila { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar-wrap {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}
.avatar-wrap:hover { border-color: var(--accent, #f0b90b); }
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: none; }
.avatar-wrap.con-foto img { display: block; }
.avatar-wrap.con-foto span { display: none; }
.avatar-wrap span { font-size: 22px; opacity: 0.5; }
.perfil-datos { min-width: 0; }
#perfilUsuario { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.perfil-rol { font-size: 11px; color: var(--text-dim); }

/* ===== Lista de favoritos con precio ===== */
.fav-item {
  /* Mismas columnas que la lista de pares, para que se lean igual. */
  display: grid;
  grid-template-columns: 1fr 86px 62px 14px;
  align-items: center;
  gap: 6px;
  padding: 7px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.fav-item:hover { background: rgba(255,255,255,0.05); }
/* Franja que separa los grupos de favoritos (Acciones, Índices, Materias primas, Forex). */
.fav-grupo { margin: 6px 0 2px; padding: 2px 6px; border-top: 1px solid var(--border, #2a2e39);
  font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-dim); }
.fav-item.activo { background: rgba(240,185,11,0.10); }
.fav-sym { font-family: var(--mono); font-weight: 700; display: inline-flex; align-items: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-pct { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--text-dim); }
.fav-pct.sube { color: #00c853; }
.fav-pct.baja { color: #e53935; }
.fav-precio { font-family: var(--mono); font-size: 12px; text-align: right; }
.fav-precio.sube { color: #26a69a; }
.fav-precio.baja { color: #ef5350; }
.fav-precio .dig-sube { color: #26a69a; }
.fav-precio .dig-baja { color: #ef5350; }
/* Quitar de favoritos: la papelera (la misma de la barra de herramientas),
   con opacidad; al pasar el ratón se ve entera. */
.fav-quitar { font-size: 15px; padding: 0 2px; opacity: 0.5; cursor: pointer; }
.fav-quitar:hover { opacity: 1; }

/* Autor del indicador en el editor */
.ci-autor { font-size: 10px; color: var(--text-dim); }

/* Subsección plegable dentro de un panel (el envío por Telegram va dentro de
   Alertas, porque configura a dónde se mandan esas mismas alertas). */
.subpanel { border-top: 1px solid var(--border, #1e232b); margin-top: 14px; padding-top: 10px; }
.subpanel-head {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  font-size: 12px; color: var(--text-dim, #8b90a0); padding: 4px 0;
}
.subpanel-head:hover { color: var(--text, #c7ccd1); }
.subpanel-head .panel-arrow { transition: transform .15s; }
.subpanel.abierto .subpanel-head .panel-arrow { transform: rotate(90deg); }
.subpanel-body { display: none; padding-top: 8px; }
.subpanel.abierto .subpanel-body { display: block; }

/* Apodo del invitado en la lista de administración */
.apodo-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--line);
  color: var(--text-dim);
  font-size: 10px;
  vertical-align: middle;
}

/* Aviso de fallo de un indicador personalizado */
.ci-error {
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 4px;
  background: rgba(242, 54, 69, 0.12);
  border: 1px solid rgba(242, 54, 69, 0.35);
  color: #f2919a;
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
}

/* Tirador para cambiar el alto de los paneles inferiores arrastrando */
.panel-resizer {
  flex: 0 0 6px;
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  border-top: 1px solid var(--line);
  position: relative;
}
.panel-resizer::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 1px;
  transform: translateX(-50%);
  width: 46px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  opacity: 0;
  transition: opacity .12s;
}
.panel-resizer:hover::after, .panel-resizer.arrastrando::after { opacity: 1; }
.panel-resizer.arrastrando { background: rgba(240,185,11,0.12); }
.panel-resizer.hidden { display: none; }
/* Mientras se arrastra no se debe seleccionar texto ni cambiar el cursor */
body.redimensionando { cursor: ns-resize; user-select: none; }

/* Aviso de descuadre entre la compilación del navegador y la del servidor */
#avisoVersion {
  position: fixed;
  left: 50%;
  /* Debajo de la barra superior, para no tapar sus botones. */
  top: 58px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 640px;
  padding: 10px 36px 10px 14px;
  border-radius: 6px;
  background: #3a2a08;
  border: 1px solid #f0b90b;
  color: #f5d67b;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
#avisoVersion code { background: rgba(0,0,0,0.35); padding: 1px 5px; border-radius: 3px; }
#cerrarAvisoVersion { position: absolute; right: 12px; top: 9px; cursor: pointer; opacity: 0.7; }
#cerrarAvisoVersion:hover { opacity: 1; }

/* Panel del Estocástico, mismas reglas que el del RSI */
#stochContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); }
#stochContainer.hidden { display: none; }

/* Panel de Fuerza: cuadro grande con la dirección resumida y sus motivos */
.fuerza-panel {
  background: rgba(13,17,23,0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 250px;   /* más estrecho: tapaba demasiado gráfico */
  max-height: 70vh;
  overflow-y: auto;
  font-family: var(--mono);
  padding: 10px 11px;
}
[data-theme="light"] .fuerza-panel { background: rgba(255,255,255,0.96); }
.fuerza-panel .fp-head {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); margin-bottom: 10px;
}
.fuerza-panel .fp-dir { font-size: 19px; font-weight: 700; line-height: 1.2; }
.fuerza-panel .fp-flecha { font-size: 16px; }
.fuerza-panel .fp-sub { font-size: 11px; color: var(--text-dim); margin: 4px 0 10px; line-height: 1.4; }
.fuerza-panel .fp-barra {
  height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 6px;
}
.fuerza-panel .fp-relleno { height: 100%; border-radius: 99px; transition: width .6s ease; }
.fuerza-panel .fp-score { font-size: 10px; color: var(--text-dim); margin-bottom: 10px; }
.fuerza-panel .fp-destacado {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11px; line-height: 1.4;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  margin-bottom: 10px;
}
.fuerza-panel .fp-motivos { display: flex; flex-direction: column; gap: 5px; }
.fuerza-panel .fp-motivo {
  font-size: 11px; line-height: 1.4;
  padding-left: 9px; border-left: 2px solid var(--line);
}
.f-alcista { color: #00c853; } /* mismo verde que las compras del libro */
.f-bajista { color: #ef5350; }
.f-neutro  { color: #f0b90b; }
.fuerza-panel .fp-relleno.f-alcista { background: #00c853; }
.fuerza-panel .fp-relleno.f-bajista { background: #ef5350; }
.fuerza-panel .fp-relleno.f-neutro  { background: #f0b90b; }
.fuerza-panel .fp-motivo.f-alcista { border-left-color: #00c853; }
.fuerza-panel .fp-motivo.f-bajista { border-left-color: #ef5350; }
.fuerza-panel .fp-motivo.f-neutro  { border-left-color: #f0b90b; }

/* Desplegable de indicadores, junto a la estrella de temporalidades */
#indicadoresWrap { position: relative; }
#indicadoresLista {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  /* Por encima de los avisos y de las notificaciones: si alguno se le ponía
     delante, se tragaba los clics y parecía que la lista respondía mal. */
  z-index: 10050;
  min-width: 250px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.55);
  padding: 4px 0;
}
#indicadoresLista.hidden { display: none; }
.ind-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.ind-item:hover { background: var(--line); color: var(--text); }
.ind-item.activo { color: var(--accent, #f0b90b); }
.ind-check { width: 12px; text-align: center; font-size: 11px; }
.ind-label { flex: 1; }
.ind-gear { width: 16px; text-align: center; opacity: 0.5; font-size: 12px; }
.ind-gear:hover { opacity: 1; }
#btnIndicadores { white-space: nowrap; }
.subpanel-body .fila-check { display:flex; align-items:center; gap:8px; margin:10px 0 4px; font-size:12px; color:var(--text); }
.subpanel-body textarea { width:100%; background:var(--bg); border:1px solid var(--line); color:var(--text); border-radius:4px; padding:6px; font-family:var(--mono); font-size:11px; resize:vertical; }

/* Cartel de alerta disparada, centrado y bien visible */
/* Los avisos salen arriba a la derecha, no tapando el gráfico. */
#avisoAlerta {
  position: fixed;
  top: 62px;
  right: 58px;
  left: auto;
  transform: none;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  min-width: 320px;
  border-radius: 10px;
  background: #1b1f27;
  border: 2px solid #f0b90b;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  cursor: pointer;
  animation: aaEntra .18s ease-out;
}
@keyframes aaEntra { from { opacity:0; transform:translateX(-50%) translateY(-10px); } to { opacity:1; } }
#avisoAlerta .aa-icono { font-size: 30px; }
#avisoAlerta .aa-titulo { font-size: 16px; font-weight: 700; color: #f0b90b; font-family: var(--mono); }
#avisoAlerta .aa-precio { font-size: 12px; color: var(--text-dim); margin-top: 3px; font-family: var(--mono); }
#avisoAlerta .aa-cerrar { margin-left: auto; opacity: .6; font-size: 14px; }
#avisoAlerta .aa-cerrar:hover { opacity: 1; }
.cfg-nota { margin: 4px 0 12px; padding: 8px 10px; border-radius: 5px; background: rgba(240,185,11,0.08); border: 1px solid rgba(240,185,11,0.3); color: var(--text-dim); font-size: 11px; line-height: 1.5; }
.cfg-nota b { color: var(--accent, #f0b90b); }
/* Panel del flujo de órdenes, mismas reglas que RSI y Estocástico */
#flowContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); }
#flowContainer.hidden { display: none; }
#ballenasContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); }
#ballenasContainer.hidden { display: none; }

/* Franja de paneles inferiores. Va superpuesta sobre el gráfico para que este
   conserve su tamaño: al encender el RSI o el Estocástico las velas no se
   aplastan, simplemente quedan tapadas por abajo. */
#franjaPaneles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px; /* deja libre el eje de fechas del gráfico */
  z-index: 3;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
#franjaPaneles:empty { display: none; }
#chartStack { position: relative; }
#rsiContainer, #stochContainer, #flowContainer {
  /* Opacos del todo y en el negro de las barras: al 96% se transparentaba lo
     de detrás y la franja de las horas de estos paneles se veía lavada. */
  background: #05070a;
}
[data-theme="light"] #rsiContainer,
[data-theme="light"] #stochContainer,
[data-theme="light"] #flowContainer { background: #ffffff; }   /* opacos del todo, sin transparencia */

/* Aviso mientras el panel de dominancia todavía no tiene datos que enseñar */

/* Lista de tutoriales: cada enlace separado del siguiente por una línea */
.tut-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tut-item:last-child { border-bottom: none; }
.tut-titulo {
  display: block; font-size: 13px; line-height: 1.4;
  color: var(--text); text-decoration: none; margin-bottom: 4px;
}
.tut-titulo:hover { color: var(--accent, #f0b90b); text-decoration: underline; }
.tut-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tut-url { font-size: 10px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tut-borrar { cursor: pointer; opacity: .6; font-size: 12px; flex-shrink: 0; }
.tut-borrar:hover { opacity: 1; color: #ef5350; }
.tut-vacio { font-size: 12px; color: var(--text-dim); }
/* Noticias de impacto */
.not-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.not-item:last-child { border-bottom: none; }
.not-cab { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-dim); margin-bottom: 4px; }
.not-imp { padding: 1px 6px; border-radius: 3px; font-weight: 700; background: rgba(240,185,11,.15); color: var(--accent, #f0b90b); }
.not-imp.muy { background: rgba(239,83,80,.18); color: #ef5350; }
.not-titulo { display: block; color: var(--text); font-weight: 600; font-size: 13px; line-height: 1.35; text-decoration: none; }
.not-titulo:hover { color: var(--accent, #f0b90b); text-decoration: underline; }
.not-resumen { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.not-activos { font-size: 11px; margin-top: 4px; }
.not-activos .alcista { color: #00c853; } .not-activos .bajista { color: #ef5350; } .not-activos .incierto { color: var(--accent, #f0b90b); }

/* Lista de indicadores activos, arriba a la izquierda del gráfico */
#leyendaIndicadores {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  max-width: 45%;
  /* Si no cabe, se desplaza con la rueda en vez de meterse debajo de los
     paneles. El alto exacto lo pone ajustarAltoLeyenda(). */
  max-height: calc(100% - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(199,204,209,.35) transparent;
}
#leyendaIndicadores::-webkit-scrollbar { width: 5px; }
#leyendaIndicadores::-webkit-scrollbar-thumb { background: rgba(199,204,209,.35); border-radius: 3px; }
.leyenda-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(11, 14, 17, 0.55);
  font-family: var(--mono);
  /* Un poco mayor: la lista de indicadores activos se lee de lejos. */
  font-size: 14.5px;
  color: #ffffff;
  pointer-events: auto;
  width: fit-content;
}
[data-theme="light"] .leyenda-item { background: rgba(255,255,255,0.7); }
.leyenda-item:hover { background: rgba(11, 14, 17, 0.9); }
.leyenda-punto { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.leyenda-nombre { white-space: nowrap; }
/* Iconos del ojo, la rueda y la X, algo mayores para poder acertarles. */
.leyenda-acc { opacity: 0; cursor: pointer; font-size: 19px; line-height: 1; padding: 0 2px; }
.leyenda-item:hover .leyenda-acc { opacity: .65; }
.leyenda-acc:hover { opacity: 1; }
.leyenda-acc.borrar:hover { color: #ef5350; }

/* Casilla de guardar sesión en la pantalla de entrada */
.recordar {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  margin: 4px 0 12px; cursor: pointer;
}
.recordar input { width: auto; margin: 0; }
.leyenda-cabecera { cursor: pointer; color: #ffffff; }

.leyenda-flecha { font-size: 9px; width: 8px; }
/* Indicador oculto: sigue en la lista, apagado */
/* Oculto: se distingue por el tachado y el icono, no atenuando el texto. */
.leyenda-item.oculto .leyenda-nombre { opacity: .75; }
.leyenda-item.oculto .leyenda-nombre { text-decoration: line-through; }
.leyenda-acc.ojo { opacity: .5; font-size: 18px; }
.leyenda-item.oculto .leyenda-acc.ojo { opacity: .9; }

/* Logo de la marca */
.login-logo { display: block; width: 110px; height: 110px; margin: 0 auto 14px; border-radius: 50%; object-fit: contain; }
.brand-logo { width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; border-radius: 50%; }

/* Panel del Sniper Oscillator */
#sniperContainer { flex: 0 0 160px; height: 160px; border-top: 1px solid var(--line); position: relative; background: #05070a; }
#sniperContainer.hidden { display: none; }
/* El lienzo va POR ENCIMA de los lienzos de la librería: sin z-index quedaba
   debajo y la cinta se dibujaba pero no se veía. */
#sniperCanvas { position: absolute; inset: 0; pointer-events: none; z-index: 3; }

/* Calendario económico */
.cal-nota { font-size: 11px; color: var(--text-dim); line-height: 1.5; margin-bottom: 10px; }
.cal-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.cal-item:last-child { border-bottom: none; }
.cal-item.pasado { opacity: .55; }
.cal-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cal-hora { font-family: var(--mono); font-size: 11px; color: var(--accent, #f0b90b); flex-shrink: 0; }
.cal-estrellas { font-size: 9px; letter-spacing: 1px; }
.cal-titulo { font-size: 12px; color: var(--text); line-height: 1.35; }
.cal-datos { display: flex; gap: 12px; margin-top: 4px; font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.cal-real { color: var(--text); font-weight: 700; }
.cal-real.mejor { color: #26a69a; }
.cal-real.peor { color: #ef5350; }
.cal-vacio { font-size: 12px; color: var(--text-dim); }

/* Variación de 24 horas, al lado del precio */
#cambio24h { font-family: var(--mono); font-size: 12px; margin-left: 6px; padding: 2px 6px; border-radius: 4px; }
#cambio24h.sube { color: #00c853; background: rgba(0,200,83,.12); }
#cambio24h.baja { color: #e53935; background: rgba(229,57,53,.12); }


/* Ideas */
.idea-adjuntos { display: flex; gap: 6px; margin-bottom: 10px; }
/* Asistente IA */
.asis-chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 55vh; overflow-y: auto; }
.asis-chat:empty { display: none; }
.asis-msg { font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: 6px; white-space: normal; word-wrap: break-word; }
.asis-yo { align-self: flex-end; max-width: 88%; background: rgba(240,185,11,.15); border: 1px solid rgba(240,185,11,.35); }
.asis-ia { background: rgba(255,255,255,.04); border: 1px solid var(--line, #1e232b); }
.asis-ia.cargando { color: var(--text-dim); font-style: italic; }
.asis-aviso { display: block; margin-top: 6px; font-size: 10px; color: var(--text-dim); }
.asis-img { margin-top: 8px; }
.asis-img img { width: 100%; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; display: block; margin-bottom: 6px; }
.asis-img .btn { width: 100%; font-size: 11px; }
.asis-img .asis-tg { margin-top: 6px; }
.asis-restantes { font-size: 11px; color: var(--text-dim); text-align: center; margin-top: 8px; }
.idea-adjuntos .btn { flex: 1; font-size: 11px; text-align: center; cursor: pointer; }
#ideaPrevia img { width: 100%; border-radius: 4px; border: 1px solid var(--line); margin-bottom: 8px; }
#ideaPrevia .quitar { font-size: 11px; color: var(--text-dim); cursor: pointer; display: block; margin-bottom: 8px; }
#ideaPrevia .quitar:hover { color: #ef5350; }
.idea-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.idea-item:last-child { border-bottom: none; }
.idea-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.idea-autor { font-size: 12px; font-weight: 700; color: var(--text); }
.idea-fecha { font-size: 10px; color: var(--text-dim); }
.idea-borrar { margin-left: auto; cursor: pointer; opacity: .5; font-size: 11px; }
.idea-borrar:hover { opacity: 1; color: #ef5350; }
.idea-texto { font-size: 12px; line-height: 1.5; color: var(--text); white-space: pre-wrap; margin-bottom: 6px; }
.idea-item img { width: 100%; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; }
.idea-vacio { font-size: 12px; color: var(--text-dim); }

/* Aviso de que el acceso está a punto de caducar */
#avisoVencimiento {
  position: fixed; left: 50%; top: 58px; transform: translateX(-50%);
  z-index: 10040; display: flex; align-items: center; gap: 12px;
  background: rgba(40, 26, 8, .97); border: 1px solid #f0b90b; border-radius: 6px;
  padding: 11px 16px; font-size: 13px; color: #f5deb3; max-width: 620px;
}
#avisoVencimiento.urgente { background: rgba(48, 14, 14, .97); border-color: #ef5350; color: #ffd6d6; }
#avisoVencimiento b { color: #fff; }
#avisoVencimiento .av-cerrar { cursor: pointer; opacity: .7; margin-left: 4px; }
#avisoVencimiento .av-cerrar:hover { opacity: 1; }

/* Reproducción de velas */
#reproWrap { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
#reproControles { display: flex; align-items: center; gap: 4px; }
#reproControles.hidden { display: none; }
.repro-b { padding: 3px 8px; font-size: 12px; }
#reproVel { background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 4px; padding: 3px 6px; font-family: var(--mono); font-size: 11px; }
#reproPos { font-family: var(--mono); font-size: 11px; color: var(--text-dim); min-width: 74px; text-align: center; }
#btnRepro.activo { background: var(--accent, #f0b90b); color: #0b0e11; }
#chartContainer.eligiendo-repro { cursor: crosshair; }

/* Lista de temporalidades con estrella */
#tfWrap { position: relative; }
#tfBoton { font-family: var(--mono); font-size: 12px; min-width: 52px; text-align: center; }
#tfDropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10050;
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  min-width: 120px; max-height: 340px; overflow-y: auto; padding: 4px 0;
}
#tfDropdown.hidden { display: none; }
.tf-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--text);
}
.tf-option:hover { background: rgba(255,255,255,.06); }
.tf-option.actual { color: var(--accent, #f0b90b); font-weight: 700; }
.fav-star { cursor: pointer; opacity: .45; font-size: 13px; }
.fav-star.on { opacity: 1; color: #f0b90b; }
.fav-star:hover { opacity: 1; }
/* Firma al pie de los avisos. Fija: no depende de ningún ajuste. */
#avisoAlerta .aa-firma { font-size: 9px; color: var(--text-dim); opacity: .75; margin-top: 6px; letter-spacing: .4px; }

/* Recuadro para escribir un texto en el gráfico */
#modalTexto {
  position: fixed; inset: 0; z-index: 10060;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
}
#modalTexto.hidden { display: none; }
#modalTexto .mt-caja {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; width: 340px;
}
#modalTexto h4 { margin: 0 0 12px; font-size: 14px; color: var(--text); }
#modalTexto textarea {
  width: 100%; min-height: 76px; resize: vertical;
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  color: var(--text); padding: 8px; font-size: 13px; font-family: inherit;
}
#modalTexto .mt-fila { display: flex; gap: 10px; margin-top: 10px; align-items: flex-end; }
#modalTexto .mt-fila > div { flex: 1; }
#modalTexto label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
#modalTexto input[type="number"], #modalTexto input[type="color"] {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; color: var(--text); padding: 5px; font-family: var(--mono); font-size: 12px;
}
#modalTexto input[type="color"] { height: 30px; padding: 2px; cursor: pointer; }
#modalTexto .mt-botones { display: flex; gap: 8px; margin-top: 14px; }
#modalTexto .mt-botones .btn { flex: 1; }
#modalTexto .mt-previa {
  margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 4px;
  background: var(--bg); text-align: center; overflow: hidden; white-space: pre-wrap;
}

/* Botones de posición: recuadro verde con L y rojo con S */
.ls-caja {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 4px;
  font-family: var(--mono); font-weight: 700; font-size: 17px;
  color: #0b0e11; line-height: 1;
}
.ls-largo { background: #00c853; }
.ls-corto { background: #e53935; color: #fff; }
.draw-btn.active .ls-caja { outline: 2px solid #0b0e11; }

/* Logo de cada moneda. El círculo con la inicial queda debajo: si la imagen
   carga, la tapa; si no, es lo que se ve. */
.par-logo {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #2a2f3a; overflow: hidden; flex-shrink: 0;
  vertical-align: middle; margin-right: 8px;
}
.par-logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transition: opacity .15s;
}
.par-inicial { color: #c7ccd1; font-weight: 700; font-family: var(--mono); line-height: 1; }
.so-nombre { display: inline-flex; align-items: center; }
#logoPar { display: inline-flex; align-items: center; margin-right: -2px; }
#logoPar .par-logo { margin-right: 4px; }
.fav-sym { display: inline-flex; align-items: center; }
/* El par en la lista de indicadores activos */
.leyenda-par { font-weight: 700; }
.leyenda-par .par-logo { margin-right: 2px; }
.leyenda-par .lp-precio { font-family: var(--mono); font-weight: 400; }
.leyenda-par .lp-pct { font-family: var(--mono); font-size: 11px; font-weight: 400; }
.leyenda-par .sube { color: #00c853; }
.leyenda-par .baja { color: #e53935; }

/* Recuadro de confirmación propio, en vez del aviso del navegador */
#modalConfirmar {
  position: fixed; inset: 0; z-index: 10070;
  background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
}
#modalConfirmar.hidden { display: none; }
#modalConfirmar .mc-caja {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 20px; width: 330px; text-align: center;
}
#modalConfirmar .mc-icono { font-size: 34px; margin-bottom: 8px; }
#modalConfirmar h4 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
#modalConfirmar .mc-texto { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; }
#modalConfirmar .mc-botones { display: flex; gap: 8px; }
#modalConfirmar .mc-botones .btn { flex: 1; }
.btn.peligro { background: #e53935; color: #fff; border-color: #e53935; }
/* Eliminar cuenta (perfil → Seguridad de la cuenta) */
.seg-titulo.seg-peligro { color: #ef5350; }
.btn.btn-eliminar-cuenta { border-color: #ef5350; color: #ef5350; background: transparent; }
.btn.btn-eliminar-cuenta:hover { background: rgba(239,83,80,.1); }
#modalEliminarCuenta {
  position: fixed; inset: 0; z-index: 10070; padding: 16px;
  background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center;
}
#modalEliminarCuenta.hidden { display: none; }
#modalEliminarCuenta .mec-caja {
  background: var(--panel); border: 1px solid #ef5350; border-radius: 10px;
  padding: 20px; width: 100%; max-width: 360px;
}
#modalEliminarCuenta h4 { margin: 0 0 8px; font-size: 16px; color: #ef5350; }
#modalEliminarCuenta .mec-texto { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 12px; }
#modalEliminarCuenta .mec-texto b { color: var(--text); }
#modalEliminarCuenta .mc-botones { display: flex; gap: 8px; margin-top: 10px; }
#modalEliminarCuenta .mc-botones .btn { flex: 1; }
.btn.peligro:hover { background: #c62828; }

/* Con las herramientas ocultas, el ojo se marca */
#btnOcultarDibujos.oculto { color: #e53935; }
.menu-ojo { position: fixed; z-index: 3000; background: var(--panel, #161a1e); border: 1px solid var(--line, #2b3139); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); padding: 4px; display: flex; flex-direction: column; min-width: 190px; }
.menu-ojo button { display: flex; align-items: center; gap: 8px; background: none; border: none; color: var(--text, #c7ccd1);
  font-size: 13px; padding: 8px 10px; border-radius: 4px; cursor: pointer; text-align: left; }
.menu-ojo button:hover { background: var(--line, #2b3139); }
.menu-ojo .mo-check { width: 14px; color: var(--accent, #f0b90b); visibility: hidden; }
.menu-ojo button.activo .mo-check { visibility: visible; }

/* Pantalla dividida */
#dividirWrap { position: relative; margin-left: 6px; }
/* Icono de pantalla dividida más grande, que se distinga de un vistazo. */
#btnDividir { font-family: var(--mono); font-size: 19px; line-height: 1; padding: 4px 10px; }
#dividirMenu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10050;
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  min-width: 130px; padding: 4px 0;
}
#dividirMenu.hidden { display: none; }
.div-op { padding: 7px 12px; font-size: 12px; cursor: pointer; color: var(--text); }
.div-op:hover { background: rgba(255,255,255,.07); }
.div-op.actual { color: var(--accent, #f0b90b); font-weight: 700; }

/* Los gráficos añadidos se reparten el espacio a la derecha o debajo */
#zonaGraficos { display: flex; flex: 1; min-height: 0; min-width: 0; }
/* Con pantalla dividida, el principal y los añadidos se reparten a partes
   iguales; sin ella, el principal ocupa todo. */
#chartStack { min-width: 0; flex: 1 1 0; }
#panelesExtra { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; min-height: 0; }
#panelesExtra.hidden { display: none; }
.grafico-extra { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); }
.ge-barra { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ge-barra input { width: 92px; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 4px; padding: 3px 6px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.ge-barra select { background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 4px; padding: 3px 4px; font-family: var(--mono); font-size: 11px; }
.ge-precio { margin-left: auto; font-family: var(--mono); font-size: 11px; flex-shrink: 0; font-variant-numeric: tabular-nums; text-align: right; }
/* Temporalidades favoritas en cada pantalla dividida (como en la principal, más compactas). */
.ge-tfs { display: flex; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ge-tfs::-webkit-scrollbar { display: none; }
.ge-tfs .tf-fav-btn { padding: 2px 6px; font-size: 11px; flex-shrink: 0; }
.ge-precio.sube { color: #00c853; }
.ge-precio.baja { color: #e53935; }
.ge-lienzo { flex: 1; min-height: 0; overflow: hidden; }

/* Rejilla de gráficos. Con "display: contents" los gráficos añadidos pasan a
   ser celdas de la rejilla igual que el principal, así que 4 pantallas quedan
   en un cuadro de 2x2 en vez de uno grande y tres apilados. */
#rejillaGraficos { display: grid; flex: 1; min-width: 0; min-height: 0; gap: 2px; }
#rejillaGraficos.p1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
#rejillaGraficos.p2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
#rejillaGraficos.p3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#rejillaGraficos.p3 #chartStack { grid-row: span 2; }
#rejillaGraficos.p4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#panelesExtra:not(.hidden) { display: contents; }
/* La foto de perfil, redonda, en la cabecera y en la barra lateral */
.ico-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.panel-ico:has(.ico-avatar), .rail-ico:has(.ico-avatar) { width: 22px; height: 22px; display: inline-block; }
/* Iconos con imagen (Asistente IA, Trading, Tutoriales, Administración). */
.ico-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.panel-ico:has(.ico-img) { width: 18px; height: 18px; display: inline-block; }
.rail-ico:has(.ico-img) { width: 22px; height: 22px; display: inline-block; }
/* PC: iconos de la barra lateral y de la cabecera de los paneles un poco más
   grandes (en móvil se vuelve a los tamaños de antes más abajo). */
#sidebar { width: 54px; }
#sidebar.desplegado { width: 354px; }
#rail { width: 54px; flex: 0 0 54px; }
.rail-btn { width: 42px; height: 42px; font-size: 21px; }
.rail-ico:has(.ico-img), .rail-ico:has(.ico-avatar) { width: 27px; height: 27px; }
.rail-ico svg { width: 22px; height: 22px; }
.panel-ico { font-size: 17px; width: 21px; }
.panel-ico:has(.ico-img) { width: 21px; height: 21px; }
.panel-ico:has(.ico-avatar) { width: 25px; height: 25px; }
.panel-ico svg { width: 21px; height: 21px; }
/* La pantalla seleccionada se marca con un borde, para saber a cuál va el par */
#rejillaGraficos:not(.p1) #chartStack.activa,
.grafico-extra.activa { outline: 1px solid var(--accent, #f0b90b); outline-offset: -1px; }
/* Arrastrar favoritos para ordenarlos */
.fav-item { cursor: grab; }
.fav-item.arrastrando { opacity: .4; }
.fav-item.encima { box-shadow: inset 0 2px 0 var(--accent, #f0b90b); }

/* Contraseñas con ojito */
.campo-clave { position: relative; display: flex; align-items: center; }
.campo-clave input { flex: 1; padding-right: 34px; }
.ver-clave {
  position: absolute; right: 8px; cursor: pointer; font-size: 14px; opacity: .5; user-select: none;
}
.ver-clave:hover { opacity: 1; }
.ver-clave.viendo { opacity: 1; color: var(--accent, #f0b90b); }
.ver-correo { position: static; display: inline-block; margin-left: 4px; }
.aviso-clave { font-size: 11px; margin-top: 5px; min-height: 14px; }
.aviso-clave.mal { color: #ef5350; }
.aviso-clave.bien { color: #00c853; }

/* La pestaña elegida se resalta */
.auth-tabs .btn { flex: 1; }
/* Globo de ideas nuevas en la barra lateral */
.rail-btn { position: relative; }
.rail-globo {
  position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px;
  background: #e53935; color: #fff; border-radius: 8px;
  font-size: 9px; font-weight: 700; line-height: 15px; text-align: center; padding: 0 3px;
}

/* Visor de imágenes de las ideas */
#visorImagen {
  position: fixed; inset: 0; z-index: 10080;
  background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center;
  padding: 48px 16px 16px; cursor: zoom-out;
}
#visorImagen img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; border-radius: 4px; }
#visorImagen .vi-barra { position: absolute; top: 10px; right: 14px; display: flex; gap: 8px; }
#visorImagen .vi-boton {
  background: rgba(30,35,43,.95); border: 1px solid #2a2f3a; color: #c7ccd1;
  border-radius: 5px; padding: 6px 12px; font-size: 12px; cursor: pointer; text-decoration: none;
}
#visorImagen .vi-boton:hover { color: #fff; border-color: #f0b90b; }
#ideaPrevia img { cursor: zoom-in; }

/* Large order */
#modalLargeOrder { position: fixed; inset: 0; z-index: 10075;
  background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
#modalLargeOrder.hidden { display: none; }
#modalLargeOrder .mlo-caja { background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 18px; width: 330px; }
#modalLargeOrder h4 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
#modalLargeOrder .mlo-nota { font-size: 11px; color: var(--text-dim); line-height: 1.5; margin-bottom: 14px; }
#modalLargeOrder input { width: 100%; }
.mlo-lados { display: flex; gap: 8px; }
.mlo-lado { flex: 1; text-align: center; padding: 8px; border: 1px solid var(--line);
  border-radius: 5px; cursor: pointer; font-size: 12px; color: var(--text-dim); }
.mlo-lado[data-lado="compra"].activo { background: #00c853; border-color: #00c853; color: #0b0e11; font-weight: 700; }
.mlo-lado[data-lado="venta"].activo { background: #e53935; border-color: #e53935; color: #fff; font-weight: 700; }
.mlo-botones { display: flex; gap: 8px; margin-top: 16px; }
.mlo-botones .btn { flex: 1; }
.draw-btn.hidden { display: none; }

/* Delta buy and sell: tabla con sus columnas */
#deltaTfPanel { pointer-events: auto; }
#deltaTfPanel.hidden { display: none; }
.corner-table.dtf { min-width: 245px; }
.dtf-cabecera, .dtf-fila {
  display: grid;
  grid-template-columns: 38px 1fr 1fr 1fr;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.dtf-cabecera { color: #c7ccd1; font-size: 11px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.dtf-cabecera span { text-align: right; }
.dtf-fila.destacada { font-size: 14px; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dtf-lista { padding: 4px 0 2px; }
.dtf-volumen { color: #c7ccd1; }
.dtf-volumen b { font-weight: 700; }
.dtf-vol-bajo { color: #e53935; }
.dtf-vol-medio { color: #f0b90b; }
.dtf-vol-optimo { color: #00c853; }
.dtf-fila[data-tf] { cursor: pointer; }
.dtf-fila[data-tf]:hover { background: rgba(255,255,255,.05); }
.dtf-fila.elegida { background: rgba(240,185,11,.16); border-left: 3px solid var(--accent, #f0b90b); }
.dtf-tf { color: var(--accent, #f0b90b); font-weight: 700; text-align: left; }
.dtf-compra { color: #00c853; text-align: right; }
.dtf-venta { color: #e53935; text-align: right; }
.dtf-delta { color: #ffffff; text-align: right; font-weight: 700; }
/* La volatilidad, al pie del panel de Fuerza */
.fp-volatilidad {
  margin-top: 8px; padding: 6px 8px; border-radius: 4px; text-align: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .4px;
}
.fp-volatilidad.v-normal  { background: rgba(120,123,134,.18); color: #9aa0ab; }
.fp-volatilidad.v-media   { background: rgba(41,182,246,.16); color: #29b6f6; }
.fp-volatilidad.v-alta    { background: rgba(255,167,38,.18); color: #ffa726; }
.fp-volatilidad.v-extrema { background: rgba(229,57,53,.20); color: #ef5350; }
.dtf-fuentes { font-size: 9.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.dtf-fuentes { margin-top: 6px; font-size: 9px; color: var(--text-dim); line-height: 1.4; font-family: var(--mono); }

/* Fuerza a la derecha con el Delta buy and sell a su izquierda */
#smcPanels { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; }
/* El Delta Spot, abajo a la izquierda */
#panelesIzquierda {
  position: absolute; left: 12px; bottom: 12px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
#panelesIzquierda > * { pointer-events: auto; }
/* La marca dorada, encima del Delta Spot */


/* Verde cuando el dato sale positivo y rojo cuando sale negativo. */
#avisoAlerta .aa-pos { color: #00c853; }
#avisoAlerta .aa-neg { color: #ef5350; }
#avisoAlerta.positivo { border-color: #00c853; }
#avisoAlerta.positivo .aa-titulo { color: #00c853; }
#avisoAlerta.negativo { border-color: #e53935; }
#avisoAlerta.negativo .aa-titulo { color: #ef5350; }

/* La franja de la fecha y la hora, con el mismo fondo que las laterales. */
#chartContainer .tv-lightweight-charts td:last-child { background: transparent; }
#ejeFechas, .franja-fecha { background: var(--barra, #000000); }

/* La marca dorada, más pequeña y algo más abajo. */

/* Filtro de importancia del calendario */
.cal-filtro { display: flex; gap: 12px; padding: 6px 2px 8px; font-size: 11px; color: var(--text-dim); }
.cal-filtro label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
/* Resumen de invitados en administración */
.resumen-invitados { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.ri-fila { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; color: var(--text-dim); }
.ri-fila b { color: var(--text); font-family: var(--mono); }
.ri-ok { color: #00c853 !important; }
.ri-no { color: #ef5350 !important; }
.ri-lista { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ri-chip { background: rgba(0,200,83,.12); color: #00c853; border-radius: 10px; padding: 2px 9px; font-size: 11px; font-family: var(--mono); }
.ri-vacio { color: var(--text-dim); font-size: 11px; }
/* Iconos a trazo de la barra superior */
#btnIndicadores svg, #btnRepro svg { display: block; color: #ffffff; }
#btnIndicadores, #btnRepro { display: inline-flex; align-items: center; justify-content: center; }
/* Panel del MACD */
#macdContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); position: relative; background: #05070a; }
#macdContainer.hidden { display: none; }
#squeezeContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); position: relative; background: #05070a; }
#squeezeContainer.hidden { display: none; }
#cciContainer { flex: 0 0 140px; height: 140px; border-top: 1px solid var(--line); position: relative; background: #05070a; }
#cciContainer.hidden { display: none; }
/* Flujo Futuros vs Spot: panel con leyenda, tarjetas de resumen y operaciones grandes */
#flujofsContainer { flex: 0 0 230px; height: 230px; border-top: 1px solid var(--line); position: relative; background: #05070a; overflow: hidden; }
#flujofsContainer.hidden { display: none; }
#flujofsContainer .ffs-leyenda { position: absolute; left: 8px; top: 4px; z-index: 5; font-size: 11px; color: #c7ccd1; pointer-events: none; white-space: nowrap; }
#flujofsContainer .ffs-resumen { position: absolute; left: 4px; right: 4px; top: 4px; z-index: 6; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
#flujofsContainer .ffs-resumen::-webkit-scrollbar { display: none; }
#flujofsContainer .ffs-resumen.hidden, #flujofsContainer .ffs-grandes.hidden { display: none; }
#flujofsContainer .ffs-tar { flex: 0 0 auto; min-width: 104px; background: rgba(17, 21, 28, 0.92); border: 1px solid #1e232b; border-radius: 6px; padding: 3px 7px; line-height: 1.25; }
#flujofsContainer .ffs-tar-t { font-size: 9.5px; color: #8b929c; }
#flujofsContainer .ffs-tar-v { font-size: 13px; font-weight: 700; white-space: nowrap; }
#flujofsContainer .ffs-tar-s { font-size: 9.5px; color: #9aa0a6; white-space: nowrap; }
#flujofsContainer .ffs-mini { display: block; height: 3px; background: #ef5350; border-radius: 2px; margin: 2px 0; overflow: hidden; }
#flujofsContainer .ffs-mini i { display: block; height: 100%; background: #26a69a; }
#flujofsContainer .ffs-grandes { position: absolute; left: 4px; top: 22px; bottom: 4px; width: 214px; z-index: 6; background: rgba(11, 14, 19, 0.94); border: 1px solid #1e232b; border-radius: 6px; padding: 4px 6px; display: flex; flex-direction: column; font-size: 10.5px; color: #c7ccd1; }
#flujofsContainer .ffs-umbrales { display: flex; gap: 3px; margin-bottom: 3px; }
#flujofsContainer .ffs-umbrales span { flex: 1; text-align: center; padding: 1px 0; border: 1px solid #2a303a; border-radius: 4px; cursor: pointer; color: #9aa0a6; font-size: 10px; }
#flujofsContainer .ffs-umbrales span.on { background: #e8eaed; color: #0b0e13; border-color: #e8eaed; font-weight: 700; }
#flujofsContainer .ffs-flujo-t { display: flex; justify-content: space-between; color: #8b929c; }
#flujofsContainer .ffs-barra { height: 3px; background: #ef5350; border-radius: 2px; margin: 2px 0; overflow: hidden; }
#flujofsContainer .ffs-barra i { display: block; height: 100%; background: #26a69a; }
#flujofsContainer .ffs-flujo-n { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 3px; }
#flujofsContainer .ffs-lista { flex: 1; overflow-y: auto; min-height: 0; border-top: 1px solid #1e232b; }
#flujofsContainer .ffs-op { display: grid; grid-template-columns: 50px 28px 1fr 44px; gap: 3px; padding: 1px 0; white-space: nowrap; }
#flujofsContainer .ffs-op span:nth-child(3), #flujofsContainer .ffs-op span:nth-child(4) { text-align: right; }
#flujofsContainer .ffs-op.c span:nth-child(4) { color: #26a69a; font-weight: 700; }
#flujofsContainer .ffs-op.v span:nth-child(4) { color: #ef5350; font-weight: 700; }
#flujofsContainer .ffs-vacio { color: #6b7280; text-align: center; padding: 8px 0; }
@media (max-width: 768px) {
  #flujofsContainer .ffs-grandes { width: 168px; font-size: 9.5px; }
  #flujofsContainer .ffs-op { grid-template-columns: 44px 24px 1fr 38px; }
  #flujofsContainer .ffs-tar { min-width: 92px; }
}
[data-theme="light"] #flujofsContainer .ffs-tar, [data-theme="light"] #flujofsContainer .ffs-grandes { background: rgba(255, 255, 255, 0.94); border-color: #e2e5ea; color: #1f2328; }
/* Marca dorada: por encima de todo, sin transparencia */
#marcaOroFija {
  position: fixed;
  width: 165px;
  height: auto;
  z-index: 9000;
  pointer-events: none;
  opacity: 1;
  display: block;
}

/* Franja inferior de las horas: negra del todo, como las laterales */
#chartStack .tv-lightweight-charts { background: transparent; }
#ejeFechas, .franja-fecha, #timeAxisStrip { background: #000000 !important; }

/* La marca no debe sobresalir hacia arriba: altura fija */
#marcaOroFija { width: 120px; height: 30px; object-fit: contain; object-position: left bottom; }



/* Paneles inferiores: negro pleno, sin transparencia. Va al final del archivo
   para que gane a cualquier regla anterior que los dejara en el gris del
   fondo, que es lo que hacía que su franja de horas se viera lavada. */
#rsiContainer, #stochContainer, #flowContainer,
#sniperContainer, #macdContainer, #squeezeContainer, #ballenasContainer, #cciContainer, #flujofsContainer { background: #05070a; }

/* Etiqueta breve de aviso: dos segundos, arriba a la derecha, sin sonido */
#etiquetaAviso {
  position: fixed;
  top: 60px;
  right: 58px;
  z-index: 10001;
  background: #05070a;
  border: 1px solid var(--accent, #f0b90b);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: #ffffff;
  pointer-events: none;
}

/* En la lista de favoritos, puntero normal en vez de manita */
#favList, #favList *, .fav-item, .fav-item * { cursor: default; }

/* ---- Mensajes del administrador ---- */
.msg-opciones { display: flex; gap: 6px; margin-bottom: 10px; }
.msg-opciones label { flex: 1; font-size: 10px; color: var(--text-dim, #8b8f98); display: flex; flex-direction: column; gap: 3px; }
.msg-opciones input { width: 100%; box-sizing: border-box; }
.msg-item { display: flex; gap: 6px; align-items: flex-start; padding: 6px 8px; margin-bottom: 6px;
  border: 1px solid var(--line, #1e232b); border-radius: 6px; font-size: 12px; }
.msg-item .msg-txt { flex: 1; white-space: pre-wrap; word-break: break-word; }
.msg-item .msg-meta { display: block; color: var(--text-dim, #8b8f98); font-size: 10px; margin-top: 3px; }
.msg-item .msg-borrar { cursor: pointer; color: #ef5350; }
#avisoAdmin { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 99999;
  max-width: min(640px, 90vw); padding: 16px 44px 16px 20px; border-radius: 10px;
  background: #0d1116; border: 1px solid #f0b90b; color: #e8e8e8; font-size: 15px; line-height: 1.4;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); white-space: pre-wrap; word-break: break-word; }
#avisoAdmin .aviso-cerrar { position: absolute; top: 8px; right: 12px; cursor: pointer; color: #8b8f98; }
.mensaje-inicio { margin: 10px 0 14px; padding: 10px 12px; border-radius: 8px; border: 1px solid #f0b90b;
  background: rgba(240,185,11,.08); color: #e8e8e8; font-size: 13px; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word; text-align: left; }

/* Pestañas de la lista de pares: todos, cripto, acciones */
.so-pestanas { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line, #1e232b);
  position: sticky; top: 0; background: #0b0e11; z-index: 1; }
.so-pestana { flex: 1 1 auto; white-space: nowrap; text-align: center; font-size: 11px; padding: 4px 6px; border-radius: 4px;
  cursor: pointer; color: #8b8f98; border: 1px solid var(--line, #1e232b); }
.so-pestana.activa { color: #0b0e11; background: #f0b90b; border-color: #f0b90b; font-weight: bold; }
.so-tag { font-size: 9px; padding: 1px 4px; border-radius: 3px; background: rgba(33,150,243,.2);
  color: #5b8def; margin-left: 4px; vertical-align: middle; }

.so-tag-bitunix { background: rgba(240,185,11,.18); color: #f0b90b; }

/* El desplegable "Indicadores (n)" se queda fijo arriba al desplazar la lista
   con la rueda; solo se mueve lo demás. */
#leyendaIndicadores .leyenda-cabecera {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(11, 14, 17, 0.95);
}
[data-theme="light"] #leyendaIndicadores .leyenda-cabecera { background: rgba(255,255,255,0.95); }

/* Soporte por Telegram */
.soporte-flotante { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; align-items: center;
  gap: 8px; padding: 10px 16px; border-radius: 24px; background: #229ED9; color: #fff; text-decoration: none;
  font-weight: bold; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.45); }
.soporte-flotante:hover { filter: brightness(1.1); }
.soporte-flotante.hidden { display: none; }
.rail-btn[data-panel="soporte"] .rail-ico { color: #229ED9; display: inline-flex; }
.panel-head[data-panel="soporte"] .panel-ico { color: #229ED9; display: inline-flex; }

/* Recuadro de precio + cuenta atrás en las pantallas divididas */
.ge-badge {
  position: absolute; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 3px 0; border-radius: 2px;
  font-family: monospace; line-height: 1.1; color: #ffffff;
  pointer-events: none; white-space: nowrap; overflow: hidden;
}
.ge-badge.hidden { display: none; }
.ge-badge .pb-precio { font-size: 12px; font-weight: 700; }
.ge-badge .pb-cuenta { font-size: 11px; opacity: 0.9; }
.ge-badge.pb-urgente .pb-cuenta { font-weight: 700; opacity: 1; }

/* Vertical de la cruz con una herramienta tomada, fuera de las velas */
.cursor-dibujo-v {
  position: absolute; top: 0; width: 0; display: none;
  border-left: 1px dashed rgba(200, 205, 215, 0.75);
  pointer-events: none; z-index: 6;
}

/* Línea vertical del cursor, compartida entre el gráfico y los paneles */
.cursor-vertical {
  position: absolute; top: 0; width: 0; display: none;
  border-left: 1px dashed rgba(200, 205, 215, 0.75);
  pointer-events: none; z-index: 6;
}

/* Firma bajo el título de la pantalla de entrada */
.auth-box p.by { text-align: center; color: var(--text-dim); font-size: 10px; margin: 0 0 4px; letter-spacing: 0.5px; }

/* Alertas de cruce de precio: línea punteada movible con su etiqueta */
.cruce-linea {
  position: absolute; left: 0; height: 7px; margin-top: -3px; z-index: 7;
  cursor: ns-resize; pointer-events: auto;
}
.cruce-linea::before {
  content: ''; position: absolute; left: 0; right: 0; top: 3px;
  border-top: 1px dashed #ffffff; opacity: 0.85;
}
.cruce-etiqueta {
  position: absolute; left: 4px; z-index: 8; transform: translateY(-50%);
  display: flex; align-items: center; gap: 0;
  background: #0b0e11; border: 1px solid #ffffff; border-radius: 3px;
  color: #ffffff; font-size: 10px; font-weight: 600; white-space: nowrap; line-height: 1.2;
  cursor: ns-resize; user-select: none; pointer-events: auto;
}
.cruce-etiqueta .ce-texto { padding: 1px 5px; }
.cruce-etiqueta .ce-borrar {
  padding: 1px 4px; font-size: 9px; border-left: 1px solid rgba(255,255,255,0.5); cursor: pointer;
}
.cruce-etiqueta .ce-borrar:hover { background: rgba(255,255,255,0.15); }
.cruce-linea.hidden, .cruce-etiqueta.hidden { display: none; }

/* Precio del cursor en la columna de precios, por encima del precio actual */
.cursor-precio {
  position: absolute; z-index: 9; pointer-events: none;
  background: #4c525e; color: #ffffff;
  font-family: monospace; font-size: 12px; line-height: 1;
  text-align: center; padding: 4px 0; border-radius: 2px; white-space: nowrap;
}
.cursor-precio.hidden { display: none; }

/* ETF al contado */
.etf-pestanas { display: flex; gap: 4px; margin: 8px 0; }
.etf-pestanas .etf-tab { flex: 1; }
.etf-pestanas .etf-tab.activo { background: var(--accent); color: #0b0e11; }
.etf-hoy { padding: 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.etf-hoy .etf-fecha { color: var(--text-dim); font-size: 11px; }
.etf-hoy .etf-total { font-family: var(--mono); font-size: 20px; font-weight: 700; margin: 2px 0 8px; }
.etf-sube { color: #26a69a; }
.etf-baja { color: #ef5350; }
.etf-fila { display: grid; grid-template-columns: 52px 1fr 64px; align-items: center; gap: 6px; font-size: 11px; margin: 3px 0; }
.etf-fila .etf-nombre { font-family: var(--mono); color: var(--text); }
.etf-fila .etf-valor { font-family: var(--mono); text-align: right; }
.etf-barra { height: 8px; background: rgba(255,255,255,0.05); border-radius: 2px; position: relative; overflow: hidden; }
.etf-barra span { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.etf-sub { color: var(--text-dim); font-size: 11px; margin: 10px 0 4px; }

.etf-meses { max-height: 260px; overflow-y: auto; }
.etf-fila-mes { grid-template-columns: 70px 1fr 78px; }


.etf-vistas { display: flex; gap: 4px; margin: 4px 0 8px; }
.etf-vistas .etf-vista { flex: 1; padding: 3px 0; font-size: 11px; }
.etf-vistas .etf-vista.activo { background: var(--accent); color: #0b0e11; }
.etf-fila-mes .etf-nombre { white-space: nowrap; }
.etf-fila-mes { grid-template-columns: 62px 1fr 98px; }
.etf-fila .etf-valor { white-space: nowrap; }

/* Selector de emojis de la barra de herramientas */
.selector-emojis {
  position: fixed; z-index: 1000; width: 360px; max-height: 460px;
  display: flex; flex-direction: column;
  background: #1e222d; border: 1px solid #363a45; border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.selector-emojis.hidden { display: none; }
.se-pestanas { display: flex; border-bottom: 1px solid #363a45; padding: 4px; gap: 2px; }
.se-tab { flex: 1; background: none; border: none; border-bottom: 2px solid transparent; font-size: 18px; padding: 4px 0; cursor: pointer; filter: grayscale(.6); }
.se-tab.activo { border-bottom-color: #2962ff; filter: none; }
.se-tab:hover { filter: none; }
.se-cuerpo { overflow-y: auto; padding: 6px 10px; flex: 1; }
.se-titulo { color: #787b86; font-size: 11px; letter-spacing: .5px; margin: 8px 0 4px; }
.se-rejilla { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.se-emoji { background: none; border: none; font-size: 24px; line-height: 1; padding: 4px 0; border-radius: 6px; cursor: pointer; }
.se-emoji:hover { background: #2a2e39; }
.se-vacio { grid-column: 1 / -1; color: #787b86; font-size: 12px; }
.se-pie { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #363a45; color: #b2b5be; font-size: 12px; }
.se-pie .se-tamano { flex: 1; }

/* ---------- Trading ---------- */
.tr-cuenta { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.tr-cuenta .tr-ex { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.tr-cuenta .tr-ex select { flex: 1; }
.tr-demo { font-size: 10px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.tr-num { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 11px; color: var(--text-dim); }
.tr-num b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.tr-lados { display: flex; gap: 4px; margin: 6px 0; }
.tr-lado { flex: 1; }
.tr-lado.activo[data-lado="long"] { background: #26a69a; color: #fff; }
.tr-lado.activo[data-lado="short"] { background: #ef5350; color: #fff; }
.tr-fila { display: flex; gap: 4px; margin: 4px 0; }
.tr-fila > * { flex: 1; min-width: 0; }
.tr-etq { display: block; font-size: 11px; color: var(--text-dim); margin: 8px 0 2px; }
#panelTrading input[type=number], #panelTrading select { width: 100%; box-sizing: border-box; }
#trApal, #trImporteRango { width: 100%; }
.tr-pcts { display: flex; gap: 3px; }
.tr-pct { flex: 1; padding: 2px 0; font-size: 11px; }
.tr-tp { display: grid; grid-template-columns: 1fr 64px 22px; gap: 4px; margin: 3px 0; }
.tr-tp button { padding: 0; }
.tr-mas { width: 100%; font-size: 11px; padding: 3px 0; margin-top: 2px; }
.tr-info { font-size: 11px; color: var(--text-dim); margin: 8px 0; line-height: 1.5; }
.tr-enviar { width: 100%; padding: 8px 0; font-weight: 700; color: #fff; }
.tr-enviar.long { background: #26a69a; } .tr-enviar.short { background: #ef5350; }
.tr-sub { font-size: 11px; color: var(--text-dim); margin: 14px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.tr-pos { border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin: 4px 0; font-size: 11px; }
.tr-pos .tr-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.tr-pos .tr-cab b { font-size: 12px; }
.tr-tag { font-size: 10px; padding: 1px 5px; border-radius: 3px; color: #fff; }
.tr-tag.long { background: #26a69a; } .tr-tag.short { background: #ef5350; }
.tr-pnl { font-family: var(--mono); font-weight: 700; }
.tr-sube { color: #26a69a; } .tr-baja { color: #ef5350; }
.tr-pos .tr-det { color: var(--text-dim); line-height: 1.5; }
.tr-pos .tr-bot { display: flex; gap: 3px; margin-top: 4px; }
.tr-pos .tr-bot button { flex: 1; padding: 2px 0; font-size: 10px; }
.tr-vacio { font-size: 11px; color: var(--text-dim); }
.tr-hist { display: grid; grid-template-columns: 1fr auto; font-size: 11px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.tr-hist span:first-child { color: var(--text-dim); }
/* Líneas de la posición en el gráfico */
.tr-linea { position: absolute; left: 0; height: 7px; margin-top: -3px; z-index: 7; pointer-events: none; }
.tr-linea::before { content: ''; position: absolute; left: 0; right: 0; top: 3px; border-top: 1px dashed currentColor; }
.tr-linea.movible { pointer-events: auto; cursor: ns-resize; }
.tr-linea.solida::before { border-top-style: solid; }
.tr-etiq { position: absolute; left: 4px; z-index: 8; transform: translateY(-50%); background: #0b0e11; border: 1px solid currentColor; border-radius: 3px; font-size: 10px; font-weight: 600; padding: 1px 5px; white-space: nowrap; pointer-events: none; }
.tr-linea.hidden, .tr-etiq.hidden { display: none; }
#panelTrading input[type=number], #panelTrading select {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 6px; border-radius: 3px; font-family: var(--mono); font-size: 12px;
}

/* Asas para sacar SL y TP desde la línea de entrada */
.tr-asas { position: absolute; z-index: 9; transform: translateY(-50%); display: flex; gap: 3px; }
.tr-asa { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; cursor: ns-resize; user-select: none;
  background: #0b0e11; border: 1px solid currentColor; }
.tr-asa.sl { color: #ef5350; }
.tr-asa.tp { color: #26a69a; }
.tr-asa:hover { background: #1e222d; }
.tr-asa.modo { color: #9aa0a6; cursor: pointer; }
.tr-asa.modo.parcial { color: #f0b90b; }
/* Recuadro del TP / SL parcial */
.tr-parcial { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3000;
  width: min(320px, calc(100vw - 32px)); background: #0b0e11; border: 1px solid #2a2f37; border-radius: 10px;
  padding: 14px 16px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.6); color: #e6e8eb; font-size: 13px; }
.tr-parcial .trp-cab { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.tr-parcial .trp-cerrar { cursor: pointer; color: #9aa0a6; padding: 2px 6px; font-size: 16px; }
.tr-parcial .trp-precio { color: #9aa0a6; font-size: 12px; margin: 2px 0 12px; }
.tr-parcial .trp-fila { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: #c7ccd1; }
.tr-parcial .trp-cant { background: #1a1e24; border-radius: 5px; padding: 5px 9px; font-family: var(--mono); }
.tr-parcial .trp-rango { width: 100%; margin: 4px 0 2px; --lleno: 50%; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; outline: none; touch-action: none;
  background: linear-gradient(to right, var(--trp-color) var(--lleno), #3a3f47 var(--lleno)); }
.tr-parcial .trp-rango::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #0b0e11; border: 3px solid var(--trp-color); cursor: pointer; }
.tr-parcial .trp-rango::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #0b0e11; border: 3px solid var(--trp-color); cursor: pointer; }
.tr-asas.orden .tr-asa.sl, .tr-asas.orden .tr-asa.tp { color: #9e9e9e; }
/* Puntos sobre el deslizador en 0, 25, 50, 75 y 100 %: la barra se pinta
   en .trp-pista, los puntos encima y el deslizador (transparente) arriba del
   todo, así el botón redondo nunca queda tapado. */
.tr-parcial .trp-pista { position: relative; margin: 4px 0 2px; height: 22px; }
.tr-parcial .trp-pista::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px;
  background: linear-gradient(to right, var(--trp-color) var(--lleno, 100%), #3a3f47 var(--lleno, 100%)); }
.tr-parcial .trp-pista .trp-rango { margin: 0; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 3; background: transparent; }
.tr-parcial .trp-puntos { position: absolute; left: 10px; right: 10px; top: 50%; height: 0; z-index: 2; pointer-events: none; }
.tr-parcial .trp-puntos i { position: absolute; top: 0; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%);
  background: #3a3f47; border: 2px solid #12161c; }
.tr-parcial .trp-puntos i.lleno { background: var(--trp-color); }
.tr-parcial .trp-puntos i.off { display: none; }
.tr-parcial .trp-marcas { display: flex; justify-content: space-between; font-size: 11px; color: #9aa0a6; margin-bottom: 12px; }
.tr-parcial .trp-marcas span { cursor: pointer; padding: 2px 0; }
.tr-parcial .trp-marcas span.off { opacity: .35; cursor: default; }
.tr-parcial .trp-nota { font-size: 11px; color: #f0b90b; margin: -6px 0 10px; }
.tr-parcial .trp-guardar { width: 100%; border: 0; border-radius: 22px; padding: 11px; font-size: 15px; font-weight: 700;
  cursor: pointer; background: var(--trp-color); color: #0b0e11; }
.tr-parcial.tp { --trp-color: #26a69a; }
.tr-parcial.sl { --trp-color: #ef5350; }
/* Móvil: asas y líneas de SL/TP más fáciles de agarrar con el dedo, y que el
   dedo las arrastre en vez de mover la página. */
.tr-asa, .tr-linea.movible { touch-action: none; }
@media (pointer: coarse) {
  .tr-asas { gap: 5px; }
  .tr-asa { font-size: 12px; padding: 5px 8px; }
  .tr-linea.movible { height: 24px; margin-top: -12px; }
  .tr-linea.movible::before { top: 12px; }
}

.tr-pos .tr-bot-etq { flex: 1.4; font-size: 10px; color: var(--text-dim); align-self: center; }

.tr-quitar { margin-left: 6px; padding: 0 3px; border-left: 1px solid currentColor; cursor: pointer; pointer-events: auto; opacity: .85; }
.tr-quitar:hover { opacity: 1; background: rgba(255,255,255,0.1); }

.tr-modo .tr-modo-b { font-size: 11px; padding: 3px 0; }
.tr-modo .tr-modo-b.activo { background: var(--accent); color: #0b0e11; }

.tr-conectar { flex: 0 0 auto; font-size: 11px; padding: 4px 8px; white-space: nowrap; }
.tr-claves { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.tr-claves.hidden { display: none; }
.tr-clave-ex { margin-bottom: 8px; }
.tr-clave-nombre { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
#panelTrading .tr-clave { width: 100%; box-sizing: border-box; margin: 2px 0; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); padding: 5px 6px; border-radius: 3px; font-family: var(--mono); font-size: 12px; letter-spacing: 1px; }

.tr-conectar.desconectar { color: #ef5350; border-color: rgba(239,83,80,.5); }
.tr-oculto { display: none !important; }
.tr-num.hidden { display: none; }

/* Selector de exchange con logo */
.tr-exsel { position: relative; flex: 1; min-width: 0; }
.tr-exsel-b { width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 8px; text-align: left; }
.tr-exsel-b .tr-flecha { margin-left: auto; opacity: .7; }
.tr-exsel-menu { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 20; background: var(--panel, #161a22);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.tr-exsel-menu.hidden { display: none; }
.tr-exsel-op { display: flex; align-items: center; gap: 8px; padding: 7px 8px; cursor: pointer; font-size: 12px; }
.tr-exsel-op:hover, .tr-exsel-op.activo { background: rgba(255,255,255,0.06); }
.tr-logo { position: relative; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; overflow: hidden;
  background: #2a2e39; display: inline-flex; align-items: center; justify-content: center; }
.tr-logo i { font-style: normal; font-size: 8px; font-weight: 700; color: #c7ccd1; }
.tr-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
/* Claves API plegables */
.tr-claves-t { width: 100%; margin-top: 6px; background: none; border: 1px dashed var(--line); color: var(--text-dim);
  border-radius: 4px; padding: 4px 8px; font-size: 11px; cursor: pointer; display: flex; justify-content: space-between; }
.tr-claves-t:hover { color: var(--text); }

/* Compartir operación */
.co-fondo { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; }
.co-fondo.hidden { display: none; }
.co-caja { background: #161a22; border: 1px solid #2a2e39; border-radius: 10px; padding: 14px; max-width: min(560px, 92vw); }
.co-caja img { width: 100%; border-radius: 8px; display: block; }
.co-botones { display: flex; gap: 6px; margin-top: 10px; }
.co-botones .btn { flex: 1; padding: 8px 0; }
.tr-compartir-h { padding: 0 6px; font-size: 11px; margin-left: 4px; }
.tr-hist span:last-child { white-space: nowrap; }

.tr-irpar { cursor: pointer; border-bottom: 1px dashed rgba(255,255,255,.35); }
.tr-irpar:hover { color: var(--accent); border-bottom-color: var(--accent); }

.co-firma { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.co-firma input { flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 6px; border-radius: 3px; }
.co-firma .btn { padding: 6px 10px; }

.tr-apals { margin-top: 4px; }
.tr-apal.activo { background: var(--accent); color: #0b0e11; }

.co-firma span { min-width: 118px; }

.bot-cats { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.bot-cat { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); cursor: pointer; }
/* Cada casilla en la misma línea que su opción, a la derecha (como "Activar el envío al bot"). */
.form-group .bot-cats .bot-cat { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; margin: 0; }
.form-group .bot-cats .bot-cat input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; padding: 0; }

/* Registro: invitación o UID */
.reg-modos { display: flex; gap: 4px; margin-bottom: 12px; }
.reg-modos .reg-modo { flex: 1; font-size: 12px; }
.reg-modos .reg-modo.activo { background: var(--accent); color: #0b0e11; }
.reg-modos.hidden, #grupoInvite.hidden, #grupoUid.hidden { display: none; }
.reg-nota { font-size: 11px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
.reg-nota a { color: var(--accent); }

/* Pantalla de inicio con la imagen de fondo (1280x800, con el suelo y el
   cielo alargados para que llene la pantalla sin bandas desenfocadas). */
#authScreen { background: #05070a; overflow: hidden; }
#authScreen::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(5, 7, 10, 0.05), rgba(5, 7, 10, 0.18)),
    url('/img/fondo-inicio.jpg?v=11') center top / cover no-repeat;
}
/* Pantallas anchas: la imagen sube un poco (el logo queda pegado arriba) para
   que el recuadro de registro quepa entero. */
@media (min-aspect-ratio: 5/4) {
  #authScreen::after {
    background:
      linear-gradient(rgba(5, 7, 10, 0.05), rgba(5, 7, 10, 0.18)),
      url('/img/fondo-inicio.jpg?v=11') center calc(-0.055 * max(100vh, 62.5vw)) / cover no-repeat;
  }
}
@media (max-aspect-ratio: 5/4) {
  #authScreen::after {
    background:
      linear-gradient(rgba(5, 7, 10, 0.55), rgba(5, 7, 10, 0.70)),
      url('/img/fondo-inicio.jpg?v=11') center center / cover no-repeat;
  }
}
@media (min-aspect-ratio: 5/4) {
  /* El recuadro va CENTRADO, debajo de "ANÁLISIS / ESTRATEGIA / RESULTADOS",
     en el hueco que deja la imagen entre la tableta (izquierda) y el
     teléfono (derecha). */
  #authScreen {
    align-items: flex-start;
    justify-content: center;
    padding-top: max(10px, calc(max(100vh, 100vw * 0.625) * 0.268));
    box-sizing: border-box;
  }
  #authScreen .auth-box {
    width: min(340px, 22vw);
    min-width: 280px;
    max-height: calc(100vh - max(10px, calc(max(100vh, 100vw * 0.625) * 0.268)) - 10px);
    padding: 16px 22px;
  }
  body #authScreen > .auth-box {
    background: rgba(10, 12, 17, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  /* Recuadro compacto: sin el logo pequeño (el grande ya está en la imagen) y
     con menos espacio entre campos. */
  #authScreen .login-logo { display: none; }
  #authScreen .auth-box h1 { margin: 0 0 2px; font-size: 18px; }
  #authScreen .auth-box .sub { margin: 2px 0 10px; }
  #authScreen .auth-box .form-group { margin-bottom: 9px; }
  #authScreen .auth-box .form-group label { margin-bottom: 3px; }
  #authScreen .auth-box .reg-modos { margin-bottom: 8px; }
  #authScreen .auth-box .reg-nota { margin-top: 4px; }
}
@media (max-aspect-ratio: 5/4) {
  #authScreen::after {
    background:
      linear-gradient(rgba(5, 7, 10, 0.55), rgba(5, 7, 10, 0.70)),
      url('/img/fondo-inicio.jpg?v=11') center center / cover no-repeat;
  }
}
#authScreen .auth-box {
  position: relative; z-index: 1;
  /* Más transparente para que se vea la tableta del gráfico de detrás. */
  background: rgba(14, 17, 23, 0.45);
  border-color: rgba(240, 185, 11, 0.30);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* Campos del inicio un poco más sólidos que el recuadro, para escribir cómodo. */
#authScreen .auth-box input[type=text], #authScreen .auth-box input[type=password] {
  background: rgba(5, 7, 10, 0.72);
}

.reg-exs { display: flex; gap: 4px; margin-bottom: 8px; }
.reg-exs:empty { display: none; }
.reg-exs .reg-ex { flex: 1; font-size: 12px; padding: 4px 0; }
.reg-exs .reg-ex.activo { border-color: var(--accent); color: var(--accent); }

/* El alto máximo del recuadro manda sobre la regla general (si no, en pantallas
   bajas se salía por abajo). En pantallas bajas, campos más compactos. */
@media (min-aspect-ratio: 5/4) {
  body #authScreen > .auth-box {
    max-height: calc(100vh - max(10px, calc(max(100vh, 100vw * 0.625) * 0.268)) - 10px);
    overflow-y: auto;
  }
}
@media (min-aspect-ratio: 5/4) and (max-height: 820px) {
  body #authScreen > .auth-box { padding: 12px 18px; }
  #authScreen .auth-box input[type=text], #authScreen .auth-box input[type=password] { padding: 6px 8px; }
  #authScreen .auth-box .form-group { margin-bottom: 6px; }
  #authScreen .auth-box .tabs button, #authScreen .auth-box .reg-modo, #authScreen .auth-box .reg-ex { padding-top: 5px; padding-bottom: 5px; }
  #authScreen .auth-box .reg-nota { font-size: 10px; line-height: 1.35; }
}

/* ---- Recuperar contraseña y seguridad de la cuenta ---- */
.enlace-olvide { display: block; text-align: center; margin-top: 10px; font-size: 12px; color: var(--accent, #f0b90b); text-decoration: none; }
.enlace-olvide:hover { text-decoration: underline; }
.enlace-privacidad { display: block; text-align: center; margin-top: 14px; font-size: 12px; color: var(--text-dim); text-decoration: underline; }
.enlace-privacidad:hover { color: var(--text); }
/* Pagos con USDT */
#modalPagoUsdt { position: fixed; inset: 0; z-index: 10080; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 12px; }
#modalPagoUsdt.hidden { display: none; }
#modalPagoUsdt .pu-caja { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: 100%; max-width: 400px; max-height: 92vh; overflow: auto; color: var(--text); }
#modalPagoUsdt h4 { margin: 2px 0 8px; font-size: 18px; color: #fff; }
.pu-cerrar { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--text-dim); font-size: 18px; cursor: pointer; }
.pu-paso { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.pu-sub { font-size: 12px; color: var(--text-dim); line-height: 1.45; margin: 6px 0 12px; }
.pu-modo { display: flex; gap: 6px; margin: 6px 0 4px; } .pu-modo .btn { flex: 1; }
.pu-plan { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.pu-plan.sel { border-color: var(--accent); background: rgba(240,185,11,.07); }
.pu-plan .p1 { display: flex; justify-content: space-between; font-weight: 700; color: #fff; font-size: 14px; }
.pu-plan .p2 { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.pu-etq { font-size: 12px; color: var(--text-dim); margin: 10px 0 4px; }
.pu-redes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pu-redes .btn { flex: 1 1 45%; font-size: 12px; } .pu-redes .btn.sel { border-color: var(--accent); color: var(--accent); }
.pu-monto { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; margin: 8px 0; }
.pu-monto b { font-family: var(--mono); font-size: 24px; color: #fff; } .pu-monto span { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.pu-qr { display: flex; justify-content: center; margin: 6px 0; } .pu-qr img { width: 170px; height: 170px; background: #fff; border-radius: 8px; padding: 6px; }
.pu-dir { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-family: var(--mono); font-size: 11px; word-break: break-all; }
.pu-copiar { margin-left: auto; background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; white-space: nowrap; }
.pu-aviso { margin-top: 10px; font-size: 12px; line-height: 1.45; background: rgba(239,83,80,.08); border: 1px solid rgba(239,83,80,.4); border-radius: 8px; padding: 8px; } .pu-aviso b { color: #ef5350; }
.pu-estado { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--accent); }
.pu-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pu-ok { text-align: center; margin: 18px 0 8px; } .pu-ic { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #00c853; color: #00c853; font-size: 36px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; background: rgba(0,200,83,.1); }
.pu-fila { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); } .pu-fila b { color: #fff; }
.pago-item { border-bottom: 1px solid var(--line); padding: 6px 0; line-height: 1.45; } .pago-item .btn { margin-top: 4px; padding: 3px 8px; font-size: 11px; }
.ok-msg { color: var(--bull, #00c853); font-size: 12px; margin-top: 8px; line-height: 1.45; }
.ok-msg:empty { display: none; }
.seg-titulo { font-size: 12px; font-weight: 600; color: var(--text, #c7ccd1); margin-bottom: 6px; }
.seg-estado { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.45; word-break: break-all; }
.seg-estado .ok { color: var(--bull, #00c853); }
.seg-estado .pend { color: #f0b90b; }
.seg-2fa-qr { display: flex; justify-content: center; margin: 4px 0 6px; }
.seg-2fa-qr img { width: 180px; height: 180px; background: #fff; border-radius: 6px; padding: 6px; }
.seg-2fa-clave { font-family: var(--mono); font-size: 11.5px; text-align: center; word-break: break-all; color: var(--text); margin-bottom: 10px; user-select: all; }
.aviso-seguridad { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px;
  background: #f0b90b; color: #0b0e11; font-size: 11px; font-weight: 700; margin-left: 4px; }
.user-item .correo-usuario { color: var(--text-dim); font-size: 11px; margin-top: 2px; word-break: break-all; }

/* Anuncio en la pantalla de inicio: abajo a la izquierda, debajo de la tableta
   de la imagen de fondo. Se amplía al pulsarlo. Solo en pantallas anchas. */
.promo-inicio {
  position: absolute; z-index: 2; left: 3.5vw; bottom: 16px;
  /* La imagen mide 1280x1360: el ancho se calcula para que quepa bajo la tableta. */
  width: min(22vw, calc((100vh - max(100vh, 62.5vw) * 0.54 - 28px) * 0.941));
  min-width: 140px; height: auto;
  border-radius: 10px; border: 1px solid rgba(240, 185, 11, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(240, 185, 11, 0.15);
  cursor: zoom-in; transition: transform .2s ease;
}
.promo-inicio:hover { transform: scale(1.03); }
/* Aviso de riesgo: arriba a la izquierda, justo encima de "GLOBAL MARKETS" de
   la imagen de fondo (la imagen mide 1,6 de ancho por 1 de alto y en pantallas
   anchas sube un 5,5 % de su alto). */
.aviso-riesgo {
  position: absolute; z-index: 2; margin: 0;
  left: calc((100vw - 1.6 * max(100vh, 62.5vw)) / 2 + 0.067 * max(100vh, 62.5vw));
  bottom: calc(100% - 0.031 * max(100vh, 62.5vw));
  width: min(30vw, 470px);
  font-size: 10.5px; line-height: 1.3; color: rgba(235, 235, 235, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
@media (max-aspect-ratio: 5/4) {
  .aviso-riesgo { left: 12px; right: 12px; top: 8px; bottom: auto; width: auto; text-align: center; }
}
.promo-grande { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, 0.8);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.promo-grande.hidden { display: none; }
.promo-grande img { max-width: min(92vw, 820px); max-height: 92vh; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.7); }
@media (max-aspect-ratio: 5/4) { .promo-inicio { display: none; } }

/* Enlaces de referido de Bitunix y Bitget en la pantalla de inicio: uno a
   cada lado del recuadro de entrada, con el enlace escrito debajo de cada
   imagen, y el texto explicativo a la derecha. */
.ref-bloque {
  position: absolute; z-index: 2; bottom: 18px;
  width: min(12.5vw, 240px); min-width: 150px;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
}
.ref-bitunix { right: calc(50% + 185px); }
.ref-bitget { left: calc(50% + 185px); }
.ref-banner {
  display: block; border-radius: 10px; overflow: hidden; line-height: 0;
  border: 1px solid rgba(240, 185, 11, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(240, 185, 11, 0.15);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ref-banner img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; display: block; }
.ref-banner:hover { transform: scale(1.04); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 22px rgba(240, 185, 11, 0.35); }
.ref-boton {
  display: block; text-align: center; text-decoration: none;
  background: #f0b90b; color: #0b0e11; font-family: var(--sans);
  font-size: clamp(12px, 0.95vw, 15px); font-weight: 700; white-space: nowrap;
  padding: 7px 6px; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  animation: refLatido 2.4s ease-in-out infinite;
}
.ref-boton:hover { background: #ffd23f; }
@keyframes refLatido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.ref-url {
  display: block; text-align: center; font-family: var(--sans); font-size: 11.5px;
  color: #f5d67a; text-decoration: underline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}
.ref-texto {
  position: absolute; z-index: 2; bottom: 18px;
  left: calc(50% + 185px + min(12.5vw, 240px) + 18px); right: 2vw;
  max-width: 230px; height: calc(min(12.5vw, 240px) * 0.52 + 70px);
  display: flex; align-items: center;
  font-family: var(--sans); font-size: clamp(12px, 1.05vw, 16px); font-weight: 700;
  line-height: 1.35; color: #f0b90b; text-transform: uppercase; letter-spacing: .5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
/* Sin sitio a los lados (pantallas estrechas o móviles): se ocultan. */
@media (max-aspect-ratio: 5/4), (max-width: 1100px) {
  .ref-bloque, .ref-texto { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ref-boton { animation: none; } }

/* ---- Marca de arriba a la izquierda con el mismo oro que la de abajo ---- */
#topbar .brand > span {
  background: linear-gradient(180deg, #fff6c2 0%, #f9dc7a 28%, #e0ad4a 52%, #b27a2e 76%, #7e5019 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}
[data-theme="light"] #topbar .brand > span { -webkit-text-fill-color: #b8860b; color: #b8860b; background: none; filter: none; }

/* ---- Lupa del buscador de pares: dibujada, más grande y sin el azul del emoji ---- */
.symbol-picker .symbol-picker-icon { opacity: 0.85; font-size: 0; line-height: 0; right: 7px; color: #d6dae0; }
.symbol-picker .symbol-picker-icon svg { width: 17px; height: 17px; display: block; }
.symbol-picker #symbolSearchInput { padding-right: 30px; }

/* ---- Barra de edición de dibujos (arriba del gráfico, como TradingView) ---- */
.barra-dibujo {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 2px;
  padding: 4px 6px; border-radius: 8px;
  background: rgba(58, 52, 58, 0.97); border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  user-select: none;
}
.barra-dibujo.hidden { display: none; }
.barra-dibujo .bd-asa { width: 18px; height: 30px; display: flex; align-items: center; color: #8d8f97; cursor: grab; }
.barra-dibujo .bd-asa svg { width: 16px; height: 16px; }
.barra-dibujo .bd-btn {
  position: relative; height: 32px; min-width: 34px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: none; border-radius: 6px; color: #f2f2f2; cursor: pointer;
}
.barra-dibujo .bd-btn:hover { background: rgba(255, 255, 255, 0.1); }
.barra-dibujo .bd-btn.activo { color: #f0b90b; }
.barra-dibujo .bd-btn > svg { width: 21px; height: 21px; }
.barra-dibujo .bd-color {
  position: absolute; left: 7px; right: 7px; bottom: 3px; height: 4px; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.barra-dibujo .bd-btn:has(.bd-color) > svg { margin-bottom: 5px; }
.barra-dibujo .bd-ancho { gap: 7px; }
.bd-linea { display: inline-block; width: 22px; background: currentColor; border-radius: 2px; }
.barra-dibujo .bd-num { font-family: var(--sans); font-size: 13px; font-weight: 700; }

.barra-dibujo-menu {
  position: absolute; z-index: 61; min-width: 150px; max-width: 280px;
  padding: 8px; border-radius: 8px;
  background: #2a2e39; border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  color: #e8e8e8; font-family: var(--sans); font-size: 12.5px;
}
.barra-dibujo-menu.hidden { display: none; }
.barra-dibujo-menu .bd-titulo { font-weight: 700; margin-bottom: 8px; }
.barra-dibujo-menu .bd-subtitulo { margin: 10px 0 6px; color: #aab0bb; }
.barra-dibujo-menu .bd-input {
  width: 100%; box-sizing: border-box; padding: 7px 8px; border-radius: 5px;
  background: #1a1d24; border: 1px solid #3d4350; color: #fff; font-size: 13px;
}
.barra-dibujo-menu .bd-input:focus { outline: none; border-color: #f0b90b; }
.barra-dibujo-menu .bd-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: #c7ccd1; }
.barra-dibujo-menu .bd-fila input[type="number"] { width: 64px; padding: 4px 6px; border-radius: 4px; background: #1a1d24; border: 1px solid #3d4350; color: #fff; }
.barra-dibujo-menu .bd-fila input[type="color"] { width: 36px; height: 24px; padding: 0; border: none; background: none; cursor: pointer; }
.barra-dibujo-menu .bd-grupo { display: inline-flex; gap: 3px; }
.barra-dibujo-menu .bd-alin {
  width: 32px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: #1a1d24; border: 1px solid #3d4350; border-radius: 5px; color: #c7ccd1; cursor: pointer;
}
.barra-dibujo-menu .bd-alin.activo { border-color: #f0b90b; color: #f0b90b; }
.barra-dibujo-menu .bd-paleta { display: grid; grid-template-columns: repeat(6, 22px); gap: 6px; }
.barra-dibujo-menu .bd-muestra { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.2); cursor: pointer; padding: 0; }
.barra-dibujo-menu .bd-muestra.activo { outline: 2px solid #f0b90b; outline-offset: 1px; }
.barra-dibujo-menu .bd-opcion {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px;
  background: transparent; border: none; border-radius: 5px; color: #e8e8e8; cursor: pointer; text-align: left; font-size: 12.5px;
}
.barra-dibujo-menu .bd-opcion:hover { background: rgba(255, 255, 255, 0.08); }
.barra-dibujo-menu .bd-opcion.activo { color: #f0b90b; }
.barra-dibujo-menu .bd-quitar {
  margin-top: 10px; width: 100%; padding: 6px; border-radius: 5px; cursor: pointer;
  background: transparent; border: 1px solid rgba(239, 83, 80, 0.5); color: #ef5350;
}

/* La marca de abajo lleva detrás el mismo tono de la franja de las horas: tapa
   las horas que quedan debajo sin que se vea un recuadro negro. */
#marcaOroFija { background: #000000; border-radius: 3px; }
[data-theme="light"] #marcaOroFija { background: #ffffff; }   /* modo claro: letras negras sobre blanco */
/* La barra de herramientas sigue negra en modo claro: iconos claros. */
[data-theme="light"] .draw-btn { color: #c7ccd1; }
[data-theme="light"] .draw-btn:hover { color: #ffffff; }
.barra-dibujo .bd-nombre { color: #d6dae0; font-family: var(--sans); font-size: 12.5px; font-weight: 600; padding: 0 8px 0 2px; white-space: nowrap; }

/* ==========================================================================
   MÓVIL Y TABLETA (768 px o menos, o pantalla táctil de hasta 1366 px).
   Solo diseño: nada de lógica.
   - Barra superior en dos filas.
   - Herramientas de dibujo flotando sobre el gráfico (como TradingView).
   - Lateral convertido en barra de iconos abajo; el panel se abre encima.
   ========================================================================== */
@media (max-width: 768px), (hover: none) and (max-width: 1366px), (pointer: coarse) and (max-width: 1366px) {
  body { height: 100vh; height: 100dvh; }
  #app:not(.hidden) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  #main { flex: 1 1 auto; height: auto; min-height: 0; flex-direction: column; }

  /* ---- Barra superior: fila 1 marca/par/precio, fila 2 temporalidades y botones ---- */
  #topbar { height: auto; flex-wrap: wrap; gap: 6px; row-gap: 4px; padding: 0 6px 4px 0; flex: 0 0 auto; }
  #topbar::before { content: ''; order: 5; flex-basis: 100%; height: 0; }
  #topbar .brand { order: 0; padding-right: 0; }
  #topbar .brand .brand-logo { width: 40px; height: 40px; }
  #topbar .brand > span { display: none; }
  .symbol-picker { order: 1; flex: 1 1 110px; min-width: 0; }
  #symbolSearchInput { width: 100%; font-size: 16px; padding-top: 4px; padding-bottom: 4px; }
  #symbolDropdown { left: -38px; width: calc(100vw - 16px); max-height: 60vh; }
  .symbol-option { grid-template-columns: 22px 1fr 84px 60px 16px; font-size: 11px; padding: 7px 8px; }
  #priceTicker { order: 2; font-size: 14px; }
  #liveIndicator { order: 3; font-size: 10px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #btnTheme, #btnSaveImage { order: 4; }
  #tfFavorites { order: 6; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; margin-left: 6px; }
  #tfFavorites::-webkit-scrollbar { display: none; }
  /* Sombra en el borde cuando hay más temporalidades deslizando con el dedo. */
  #tfFavorites.mas-der { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); }
  #tfFavorites.mas-izq { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 26px), transparent); }
  #tfFavorites.mas-izq.mas-der { -webkit-mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent); }
  #tfWrap { order: 7; }
  #indicadoresWrap { order: 8; }
  #dividirWrap { order: 9; margin-left: 0; }
  #reproWrap { order: 10; margin-left: 0; flex-wrap: wrap; }
  #btnIrActual { order: 11; }
  #topbar .spacer { display: none; }
  #topbar .btn { padding: 5px 8px; font-size: 11px; min-height: 0; }
  /* En el móvil solo hay 2 pantallas (una encima de otra): el icono son 2 rectángulos. */
  #topbar #btnDividir { display: block; vertical-align: top; position: relative; width: 38px; height: 30px; padding: 0; font-size: 0; color: transparent; box-sizing: border-box; }
  #topbar #btnDividir::before, #topbar #btnDividir::after { content: ''; position: absolute; left: 50%; width: 18px; height: 7px;
    transform: translateX(-50%); border: 1.5px solid var(--text); border-radius: 2px; box-sizing: border-box; }
  #topbar #btnDividir::before { top: 6px; }
  #topbar #btnDividir::after { bottom: 6px; }
  .tf-fav-btn { padding: 5px 7px; flex-shrink: 0; }
  /* Fila de temporalidades y botones: todos con la misma altura. */
  #tfFavorites .tf-fav-btn, #topbar #tfBoton, #topbar #btnIndicadores, #topbar #btnDividir,
  #topbar #btnRepro, #topbar #btnIrActual, #topbar .repro-b {
    height: 30px; min-height: 30px; max-height: 30px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; line-height: 1; vertical-align: top;
  }
  #tfFavorites { align-items: center; }
  /* El de la lista de temporalidades, del mismo ancho que los botones de al lado. */
  #topbar #tfBoton { min-width: 0; width: 38px; padding-left: 0; padding-right: 0; font-size: 11px; letter-spacing: -0.3px; white-space: nowrap; }
  /* Sin flex en los envoltorios: sus menús (position: fixed) se colocaban centrados
     sobre el botón y se salían por arriba de la pantalla. */
  #tfWrap, #indicadoresWrap, #dividirWrap, #reproWrap { line-height: 0; }
  #tfDropdown, #indicadoresLista, #dividirMenu, #reproControles { line-height: normal; }

  /* Menús de la barra: sin salirse por la derecha de la pantalla. */
  #tfDropdown, #indicadoresLista, #dividirMenu {
    position: fixed; top: auto; left: 8px; right: auto; margin-top: 6px;
    max-width: calc(100vw - 16px); max-height: 60vh;
  }
  .ind-item, .tf-option, .div-op { padding-top: 10px; padding-bottom: 10px; }

  /* ---- Herramientas de dibujo flotando a la izquierda del gráfico ---- */
  #chartRow { position: relative; }
  #drawToolbar {
    /* Pegada al borde izquierdo de la pantalla, sin hueco. */
    position: absolute; left: 0; top: 6px; z-index: 20;
    max-height: calc(100% - 110px); padding: 4px 2px; gap: 1px;
    border: 1px solid var(--line); border-left: none; border-radius: 0 8px 8px 0;
    background: rgba(0, 0, 0, 0.88); scrollbar-width: none;
  }
  #drawToolbar::-webkit-scrollbar { display: none; }
  .draw-btn { width: 34px; height: 34px; font-size: 20px; }
  .draw-btn svg { width: 22px; height: 22px; }
  #drawToolbar .draw-sep { width: 22px; }
  /* Hasta el eje de precios: con el 55% se cortaban los botones (ojo,
     engranaje, ✕) de los nombres largos. */
  #leyendaIndicadores { left: 48px; max-width: calc(100% - 130px); }
  /* Nombres largos: se recortan con "…" y los botones siempre quedan a la vista. */
  .leyenda-item { max-width: 100%; }
  .leyenda-nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .leyenda-acc, .leyenda-punto { flex-shrink: 0; }

  /* Tablas del gráfico (Delta, Fuerza, Delta Spot) más pequeñas. */
  #smcPanels { right: 6px; bottom: 6px; transform: scale(0.72); transform-origin: bottom right; }
  #panelesIzquierda { left: 6px; bottom: 6px; transform: scale(0.72); transform-origin: bottom left; }

  /* Pantalla dividida: uno debajo de otro en vez de lado a lado. */
  #rejillaGraficos.p2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  #rejillaGraficos.p3 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; }
  #rejillaGraficos.p3 #chartStack { grid-row: auto; }
  .grafico-extra { border-left: none; border-top: 1px solid var(--line); }

  /* ---- Lateral: barra de iconos abajo y el panel se abre encima ---- */
  #sidebar { width: 100% !important; flex: 0 0 auto; flex-direction: column; transition: none; }
  #rail {
    order: 2; width: 100%; flex: 0 0 50px; height: 50px;
    flex-direction: row; justify-content: space-around; align-items: center;
    padding: 0 4px; gap: 2px; border-left: none; border-top: 1px solid var(--line);
    overflow-x: auto; scrollbar-width: none;
  }
  #rail::-webkit-scrollbar { display: none; }
  .rail-btn { width: 40px; height: 40px; flex-shrink: 0; font-size: 19px; }
  .rail-ico:has(.ico-img), .rail-ico:has(.ico-avatar) { width: 22px; height: 22px; }
  .rail-ico svg { width: 18px; height: 18px; }
  .panel-ico { font-size: 15px; width: 18px; }
  .panel-ico:has(.ico-img) { width: 18px; height: 18px; }
  .panel-ico:has(.ico-avatar) { width: 22px; height: 22px; }
  .panel-ico svg { width: 18px; height: 18px; }
  .rail-btn.activo { box-shadow: inset 0 2px 0 var(--accent, #f0b90b); }
  #flyout { order: 1; width: 100%; height: 0; border-left: none; }
  #sidebar.desplegado #flyout { width: 100%; height: 55vh; height: 55dvh; overflow-y: auto; border-top: 1px solid var(--line); }

  /* Campos a 16 px: así el iPhone no hace zoom al escribir. */
  .form-group input, .form-group select, .form-group textarea,
  #flyout input:not([type=checkbox]):not([type=radio]):not([type=range]), #flyout select, #flyout textarea { font-size: 16px; }
  .btn { min-height: 34px; }

  /* ---- Ventanas y avisos dentro de la pantalla ---- */
  .cfg-box, #modalTexto .mt-caja, #modalConfirmar .mc-caja, #modalLargeOrder .mlo-caja {
    width: calc(100vw - 24px); max-width: 360px;
  }
  .selector-emojis { left: 8px !important; right: 8px; width: auto; max-height: 60vh; }
  .se-rejilla { grid-template-columns: repeat(8, 1fr); }
  #toastContainer { top: 96px; left: 8px; right: 8px; }
  .toast { min-width: 0; }
  #avisoAlerta { top: 96px; right: 8px; left: 8px; min-width: 0; padding: 12px 14px; }
  .barra-dibujo { max-width: calc(100vw - 12px); overflow-x: auto; }

  /* ---- Pantalla de entrada ---- */
  body #authScreen { align-items: center; padding: 12px; overflow-y: auto; }
  body #authScreen > .auth-box {
    width: 100%; max-width: 360px; min-width: 0;
    max-height: calc(100dvh - 24px); padding: 20px 18px;
  }
  #authScreen .auth-box input { font-size: 16px; }
}

/* Pantallas táctiles (sin ratón): la rueda y la X de la lista de indicadores
   solo aparecían al pasar el ratón por encima, así que en el móvil no se
   veían. Aquí se muestran siempre y con más sitio para el dedo. */
@media (hover: none) {
  .leyenda-acc { opacity: .75; padding: 2px 5px; }
  .leyenda-acc.ojo { opacity: .75; }
  .leyenda-item { gap: 6px; padding: 3px 7px; }
}

/* ---- Ventana de configuración con el aspecto nuevo (SMC Pro Ultra) ---- */
.cfg-box.estilo-tv {
  width: min(560px, calc(100vw - 24px)); max-width: none;
  background: linear-gradient(180deg, #2a2b2e 0%, #1f2023 100%);
  border: 1px solid #3a3b3f; border-radius: 10px; padding: 0;
  box-shadow: 0 18px 60px rgba(0,0,0,.65); color: #e8e8e8;
}
.cfg-box.estilo-tv .cfg-header {
  padding: 18px 22px 14px; margin: 0; border-bottom: 1px solid #3a3b3f;
  color: #f2f2f2; font-size: 18px; font-weight: 700;
}
.cfg-box.estilo-tv .cfg-header #cfgClose { font-size: 20px; color: #bdbdbd; }
.cfg-box.estilo-tv #cfgFields { padding: 6px 22px 10px; margin: 0; }
.cfg-box.estilo-tv .tv-seccion { padding: 14px 0 6px; }
.cfg-box.estilo-tv .tv-seccion + .tv-seccion { border-top: 1px solid #34353a; }
.cfg-box.estilo-tv .tv-titulo {
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: #9a9ba0; margin: 4px 0 12px;
}
.cfg-box.estilo-tv .tv-campos { transition: opacity .15s; }
.cfg-box.estilo-tv .tv-seccion.apagada .tv-campos { opacity: .4; }
.cfg-box.estilo-tv .tv-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 0 12px; font-size: 13px; font-weight: 600; color: #e8e8e8;
}
.cfg-box.estilo-tv .tv-fila.tv-col { flex-direction: column; align-items: stretch; gap: 6px; }
.cfg-box.estilo-tv .tv-et { flex: 1 1 auto; min-width: 0; }
.cfg-box.estilo-tv .tv-check { justify-content: flex-start; gap: 10px; cursor: pointer; }
.cfg-box.estilo-tv .tv-onoff { font-weight: 700; color: #ffffff; }
/* Casillas cuadradas redondeadas, blancas al marcarse */
.cfg-box.estilo-tv input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; margin: 0;
  width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid #9a9ba0;
  background: transparent; cursor: pointer; position: relative;
}
.cfg-box.estilo-tv input[type=checkbox]:checked { background: #ececec; border-color: #ececec; }
.cfg-box.estilo-tv input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #1f2023; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* Cajas de número, desplegables y textos con borde fino redondeado */
.cfg-box.estilo-tv input[type=number], .cfg-box.estilo-tv select, .cfg-box.estilo-tv textarea {
  background: transparent; color: #f2f2f2; border: 1px solid #6b6c71; border-radius: 6px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
}
.cfg-box.estilo-tv input[type=number] { width: 140px; flex: 0 0 140px; padding: 7px 10px; }
.cfg-box.estilo-tv select { width: 220px; flex: 0 1 220px; min-width: 0; padding: 7px 8px; }
.cfg-box.estilo-tv select option { background: #2a2b2e; color: #f2f2f2; }
.cfg-box.estilo-tv textarea { width: 100%; padding: 7px 10px; min-height: 44px; resize: vertical; }
.cfg-box.estilo-tv input[type=number]:focus, .cfg-box.estilo-tv select:focus, .cfg-box.estilo-tv textarea:focus {
  outline: none; border-color: #d9d9d9;
}
/* Muestras de color cuadradas, como en la referencia */
.cfg-box.estilo-tv input[type=color] {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto;
  width: 40px; height: 34px; padding: 3px; border: 1px solid #6b6c71; border-radius: 6px;
  background: transparent; cursor: pointer;
}
.cfg-box.estilo-tv input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cfg-box.estilo-tv input[type=color]::-webkit-color-swatch { border: none; border-radius: 3px; }
.cfg-box.estilo-tv input[type=color]::-moz-color-swatch { border: none; border-radius: 3px; }
.cfg-box.estilo-tv .cfg-nota { margin: 2px 0 12px; }
/* Pie: Restablecer a la izquierda, Cancelar y Aceptar a la derecha */
.cfg-box.estilo-tv .cfg-footer {
  padding: 12px 22px 16px; margin: 0; border-top: 1px solid #3a3b3f; gap: 10px;
}
.cfg-box.estilo-tv .cfg-footer .btn {
  flex: 0 0 auto; border-radius: 8px; padding: 8px 18px; font-weight: 700; font-size: 13px;
  background: transparent; border: 1.5px solid #d9d9d9; color: #f2f2f2;
}
.cfg-box.estilo-tv .cfg-footer #cfgReset { margin-right: auto; border-color: #6b6c71; color: #cfcfcf; }
.cfg-box.estilo-tv .cfg-footer #cfgApply { background: #f2f2f2; border-color: #f2f2f2; color: #1f2023; }
/* ---- Móvil: la ventana ocupa toda la pantalla, como una hoja ---- */
@media (max-width: 600px) {
  #cfgModal:has(.estilo-tv) { align-items: stretch; justify-content: stretch; background: #1f2023; }
  .cfg-box.estilo-tv {
    width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none;
    border: 0; border-radius: 0; box-shadow: none;
  }
  /* Cabecera fija arriba, respetando la muesca del teléfono */
  .cfg-box.estilo-tv .cfg-header {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; font-size: 18px;
  }
  .cfg-box.estilo-tv .cfg-header #cfgClose { font-size: 24px; padding: 4px 6px; margin-right: -6px; }
  .cfg-box.estilo-tv #cfgFields { padding: 2px 16px 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .cfg-box.estilo-tv .tv-seccion { padding: 16px 0 4px; }
  .cfg-box.estilo-tv .tv-titulo { font-size: 12px; margin-bottom: 10px; }
  /* Filas más altas para el dedo */
  .cfg-box.estilo-tv .tv-fila { min-height: 42px; margin-bottom: 6px; font-size: 15px; gap: 12px; }
  .cfg-box.estilo-tv .tv-check { padding: 6px 0; }
  .cfg-box.estilo-tv .tv-onoff { font-size: 16px; }
  .cfg-box.estilo-tv input[type=checkbox] { width: 24px; height: 24px; border-radius: 5px; }
  .cfg-box.estilo-tv input[type=checkbox]:checked::after { left: 7px; top: 3px; width: 6px; height: 12px; }
  /* 16px en las cajas: así el iPhone no amplía la pantalla al tocarlas */
  .cfg-box.estilo-tv input[type=number], .cfg-box.estilo-tv select, .cfg-box.estilo-tv textarea { font-size: 16px; }
  .cfg-box.estilo-tv input[type=number] { width: 104px; flex: 0 0 104px; padding: 9px 10px; }
  .cfg-box.estilo-tv input[type=color] { width: 48px; height: 40px; }
  /* Los desplegables llevan textos largos: etiqueta arriba y desplegable a todo el ancho */
  .cfg-box.estilo-tv .tv-fila.tv-sel { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 12px; }
  .cfg-box.estilo-tv .tv-fila.tv-sel select { width: 100%; flex: 0 0 auto; padding: 10px 10px; }
  .cfg-box.estilo-tv textarea { min-height: 64px; }
  .cfg-box.estilo-tv .cfg-nota { font-size: 12px; }
  /* Pie fijo abajo con los tres botones del mismo ancho */
  .cfg-box.estilo-tv .cfg-footer {
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; background: #1f2023;
  }
  .cfg-box.estilo-tv .cfg-footer .btn { flex: 1 1 0; padding: 12px 6px; font-size: 15px; min-height: 46px; }
  .cfg-box.estilo-tv .cfg-footer #cfgReset { margin-right: 0; }
}
/* La marca de agua de la esquina quedaba por encima de la ventana y tapaba
   el botón Restablecer en el móvil. */
#cfgModal:not(.hidden):has(.estilo-tv) ~ #marcaOroFija { display: none; }

/* Barra para subir y bajar dentro de la ventana de configuración: visible,
   para que se note que hay más ajustes debajo en pantallas pequeñas. */
.cfg-box.estilo-tv #cfgFields {
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: #6b6c71 transparent;
}
.cfg-box.estilo-tv #cfgFields::-webkit-scrollbar { width: 8px; }
.cfg-box.estilo-tv #cfgFields::-webkit-scrollbar-thumb { background: #6b6c71; border-radius: 4px; }
.cfg-box.estilo-tv #cfgFields::-webkit-scrollbar-track { background: transparent; }
/* En pantallas de PC bajas la ventana nunca pasa del alto disponible. */
@media (max-height: 700px) and (min-width: 601px) {
  .cfg-box.estilo-tv { max-height: calc(100vh - 24px); }
}
/* Ventana de temporalidades favoritas con el mismo aspecto */
.cfg-box.estilo-tv .tf-fav-checkbox { width: 18px; height: 18px; }

/* En línea (panel del administrador) */
.punto-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71;
  box-shadow: 0 0 0 2px rgba(46,204,113,.25); margin-right: 6px; vertical-align: middle; }
.ri-chip.ri-chip-online { border-color: rgba(46,204,113,.5); }
.tag-online { margin-left: 8px; font-size: 10px; color: #2ecc71; white-space: nowrap; }

/* ---- Modo claro: lo que quedaba blanco sobre blanco o negro sobre negro ---- */
/* Las barras de arriba siguen negras en modo claro: sus botones conservan el
   aspecto del modo oscuro (antes las temporalidades eran blancas con letra
   blanca y los botones de la derecha, negros con letra negra). */
[data-theme="light"] .tf-fav-btn { background: transparent; border-color: #3a3f47; color: #ffffff; }
[data-theme="light"] .tf-fav-btn.active { border-color: var(--accent); background: rgba(240,185,11,0.12); }
[data-theme="light"] #topbar .btn,
[data-theme="light"] #tfWrap .btn { color: #e8e8e8; border-color: #3a3f47; }
/* Leyenda del gráfico (BTC, Indicadores, nombres y sus botones) sobre fondo claro */
[data-theme="light"] #leyendaIndicadores,
[data-theme="light"] #leyendaIndicadores .leyenda-nombre,
[data-theme="light"] #leyendaIndicadores .leyenda-flecha,
[data-theme="light"] #leyendaIndicadores .leyenda-acc { color: #1a1d23; }

/* ---- Miedo y Codicia (panel de ETF) ---- */
.fng-caja { border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 4px; margin-bottom: 12px; }
.fng-titulo { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.fng-sub { font-weight: 400; color: var(--text-dim); font-size: 11px; margin-left: 4px; }
.fng-hoy { position: relative; text-align: center; color: var(--text); }
.fng-medidor { width: 100%; max-width: 220px; display: block; margin: 0 auto; color: var(--text); }
.fng-valor { font-family: var(--mono); font-size: 30px; font-weight: 800; line-height: 1; margin-top: -6px; }
.fng-nombre { font-weight: 700; font-size: 13px; margin: 2px 0 8px; }
.fng-comps { display: flex; gap: 6px; margin-bottom: 8px; }
.fng-comp { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 5px 2px; }
.fng-comp span { display: block; font-size: 10px; color: var(--text-dim); }
.fng-comp b { display: block; font-family: var(--mono); font-size: 16px; }
.fng-comp small { display: block; font-size: 9.5px; color: var(--text-dim); white-space: nowrap; }
.fng-grafico { width: 100%; height: 80px; display: block; color: var(--text); }
.fng-eje { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); margin: 2px 0 6px; }

/* Calendario: aviso de posible descuento previo */
.cal-descuento { margin-top: 4px; font-size: 11px; color: #f0b90b; line-height: 1.35; }
.cal-datos { flex-wrap: wrap; row-gap: 2px; }

/* Modo claro: el buscador de pares está en la barra negra de arriba, así que
   se queda oscuro como en el modo oscuro (antes salía una caja blanca). */
[data-theme="light"] #symbolSearchInput { background: #0b0e11; color: #e8e8e8; border-color: #3a3f47; }
[data-theme="light"] #symbolSearchInput::placeholder { color: #8a8f98; }
/* La fila del par en la leyenda (BTC y su precio) también en oscuro sobre claro */
[data-theme="light"] #leyendaIndicadores .leyenda-item { color: #1a1d23; }

/* Aviso de reconexión con el servidor (ya no se cierra la sesión) */
#avisoReconexion { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 9500; background: #2a1f00; color: #f0b90b; border: 1px solid #f0b90b; border-radius: 20px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.5); white-space: nowrap; }
#avisoReconexion .ar-punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f0b90b;
  margin-right: 6px; vertical-align: middle; animation: arLatido 1s ease-in-out infinite; }
@keyframes arLatido { 50% { opacity: .25; } }

/* Móvil: la barra de herramientas de la izquierda tapaba el par de las
   pantallas añadidas; su barra empieza a la derecha de la herramienta. */
@media (max-width: 768px) {
  /* El par se corre a la izquierda y más estrecho: así caben en la misma
     fila las temporalidades favoritas, sin quitarle alto al gráfico. */
  .grafico-extra .ge-barra { padding-left: 6px; gap: 4px; }
  .grafico-extra .ge-barra input { width: 52px; padding-left: 6px; padding-right: 4px; }
  .grafico-extra .ge-tfs { flex: 1 1 auto; }
}

/* Entre un indicador y otro no debe quedar hueco: la franja para estirar
   los paneles era transparente y por ella se veía el gráfico de detrás.
   Ahora es del mismo color que los paneles (sigue sirviendo para estirar). */
.panel-resizer { background: #05070a; }
[data-theme="light"] .panel-resizer { background: #ffffff; }
.panel-resizer.arrastrando { background: #2a2205; }
/* En modo claro el MACD y el Sniper siguen oscuros: su franja, igual que ellos */
[data-theme="light"] .panel-resizer:has(+ #macdContainer),
[data-theme="light"] .panel-resizer:has(+ #sniperContainer) { background: #05070a; }

/* Fuerza y Delta buy and sell: siempre del tamaño que tienen en pantalla
   dividida (más pequeños), haya una pantalla o varias. */
#smcPanels { transform: scale(0.72); transform-origin: bottom right; }
/* Pantalla dividida: Delta spot más pequeño, para que no tape tanto el gráfico. */
#rejillaGraficos:is(.p2, .p3, .p4) #panelesIzquierda { transform: scale(0.72); transform-origin: bottom left; }
@media (max-width: 768px) {
  #smcPanels { transform: scale(0.55); }
  #rejillaGraficos:is(.p2, .p3, .p4) #panelesIzquierda { transform: scale(0.55); }
  /* Solo en el móvil: sin el botón de la cámara, el gráfico sube y aprovecha
     ese espacio. La captura sigue en el menú del gráfico. */
  #btnSaveImage { display: none; }
}
/* Móvil: la franja para estirar los paneles de abajo, más alta para el dedo */
@media (pointer: coarse) {
  .panel-resizer { flex-basis: 14px; height: 14px; touch-action: none; }
  .panel-resizer::after { opacity: 0.8; top: 5px; }
}

/* ---- Lista de indicadores: recuadro con flecha y número ---- */
#leyendaIndicadores .leyenda-cabecera.leyenda-boton {
  display: inline-flex; align-items: center; gap: 8px; width: auto; align-self: flex-start;
  padding: 4px 10px; border: 1px solid #3a3f47; border-radius: 6px; background: rgba(11,14,17,0.85);
}
#leyendaIndicadores .leyenda-cabecera.leyenda-boton .leyenda-flecha { width: auto; display: inline-flex; font-size: inherit; }
#leyendaIndicadores .leyenda-cuenta { font-family: var(--mono); font-size: 13px; }
[data-theme="light"] #leyendaIndicadores .leyenda-cabecera.leyenda-boton { border-color: #c7ccd1; background: rgba(255,255,255,0.95); }

/* ---- Barra de herramientas plegable ---- */
#chartRow { position: relative; }
#drawToolbar.plegada { display: none !important; }
#pestanaBarra {
  position: absolute; left: 0; bottom: 32%; z-index: 21;
  width: 22px; height: 64px; display: flex; align-items: center; justify-content: center;
  background: rgba(11,14,17,0.92); color: #c7ccd1; cursor: pointer;
  border: 1px solid #3a3f47; border-left: none; border-radius: 0 8px 8px 0;
}
#pestanaBarra.hidden { display: none; }
#pestanaBarra:hover { color: #ffffff; }
[data-theme="light"] #pestanaBarra { background: rgba(255,255,255,0.95); color: #3a3f47; border-color: #c7ccd1; }

/* Recuadro de la lista de indicadores: negro, con la flecha y el número del
   mismo gris que los iconos de la barra de herramientas (también en modo claro). */
#leyendaIndicadores .leyenda-cabecera.leyenda-boton,
[data-theme="light"] #leyendaIndicadores .leyenda-cabecera.leyenda-boton {
  background: #000000; border-color: var(--line); color: #8f959e;
}
#leyendaIndicadores .leyenda-cabecera.leyenda-boton .leyenda-flecha,
#leyendaIndicadores .leyenda-cabecera.leyenda-boton .leyenda-cuenta,
[data-theme="light"] #leyendaIndicadores .leyenda-cabecera.leyenda-boton .leyenda-flecha,
[data-theme="light"] #leyendaIndicadores .leyenda-cabecera.leyenda-boton .leyenda-cuenta { color: #8f959e; }
#leyendaIndicadores .leyenda-cabecera.leyenda-boton:hover .leyenda-flecha,
#leyendaIndicadores .leyenda-cabecera.leyenda-boton:hover .leyenda-cuenta { color: #e8e8e8; }
/* La pestaña de la barra plegada, igual */
#pestanaBarra, [data-theme="light"] #pestanaBarra { background: #000000; color: #8f959e; border-color: var(--line); }

/* Delta spot pegado a la izquierda (PC y móvil) */
#panelesIzquierda { left: 0; }
@media (max-width: 768px) { #panelesIzquierda { left: 0; } }
/* Pestaña de la barra plegada: más baja */
#pestanaBarra { height: 40px; width: 20px; }

/* Ventanas de configuración: gris más oscuro */
.cfg-box.estilo-tv { background: linear-gradient(180deg, #1c1d20 0%, #151618 100%); border-color: #2c2d31; }
.cfg-box.estilo-tv .cfg-header { border-bottom-color: #2c2d31; }
.cfg-box.estilo-tv .cfg-footer { border-top-color: #2c2d31; }
.cfg-box.estilo-tv .tv-seccion + .tv-seccion { border-top-color: #26272b; }
@media (max-width: 600px) {
  #cfgModal:has(.estilo-tv) { background: #151618; }
  .cfg-box.estilo-tv .cfg-footer { background: #151618; }
}
/* Móvil con la barra de herramientas plegada: BTC y la lista de indicadores
   pegados a la izquierda, como en el PC. */
@media (max-width: 768px) {
  body.barra-plegada #leyendaIndicadores { left: 6px; }
}

/* ---- Todas las ventanas de configuración con el mismo color y tono ----
   Las demás ventanas (y sus recuadros: números, textos, desplegables y
   colores) toman el mismo gris que la de SMC Pro Ultra, en vez del azul
   oscuro del panel. Solo en el tema oscuro. */
:root:not([data-theme="light"]) .cfg-box:not(.estilo-tv) {
  background: linear-gradient(180deg, #2a2b2e 0%, #1f2023 100%);
  border-color: #3a3b3f;
  color: #e8e8e8;
}
:root:not([data-theme="light"]) .cfg-box:not(.estilo-tv) .cfg-footer { border-top-color: #3a3b3f; }
:root:not([data-theme="light"]) .cfg-box:not(.estilo-tv) .cfg-field label { color: #9a9ba0; }
:root:not([data-theme="light"]) .cfg-box .cfg-field input[type="number"],
:root:not([data-theme="light"]) .cfg-box .cfg-field input[type="text"],
:root:not([data-theme="light"]) .cfg-box .cfg-field textarea,
:root:not([data-theme="light"]) .cfg-box .cfg-field select,
:root:not([data-theme="light"]) .cfg-box .cfg-field input[type="color"] {
  background: transparent;
  border: 1px solid #6b6c71;
  border-radius: 6px;
  color: #f2f2f2;
}
:root:not([data-theme="light"]) .cfg-box .cfg-field select option { background: #2a2b2e; color: #f2f2f2; }
:root:not([data-theme="light"]) .cfg-box .cfg-field input:focus,
:root:not([data-theme="light"]) .cfg-box .cfg-field select:focus,
:root:not([data-theme="light"]) .cfg-box .cfg-field textarea:focus { outline: none; border-color: #d9d9d9; }

/* ---- Pantalla dividida: las celdas pueden encoger y volver a crecer ----
   Con "1fr" una celda no puede quedar más estrecha que el gráfico que lleva
   dentro. Al abrir una opción de la barra lateral (o las de abajo en el
   móvil), el sitio se reducía pero los gráficos no podían encoger; al
   cerrarla se quedaban descolocados hasta salir y volver a dividir.
   Con minmax(0, 1fr) se reparten el sitio que haya en cada momento. */
#rejillaGraficos.p2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#rejillaGraficos.p3,
#rejillaGraficos.p4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
#rejillaGraficos:not(.p1) > #chartStack,
#rejillaGraficos:not(.p1) .grafico-extra { min-width: 0; min-height: 0; }
@media (max-width: 768px), (hover: none) and (max-width: 1366px), (pointer: coarse) and (max-width: 1366px) {
  #rejillaGraficos.p2 { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  #rejillaGraficos.p3 { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
}

/* Precio de entrada de la posición en la columna de precios (sin
   transparencia), por debajo del recuadro del precio actual. */
.tr-entrada-eje {
  position: absolute; z-index: 2; box-sizing: border-box;
  color: #ffffff; font: 600 11px/18px monospace; height: 18px;
  text-align: center; border-radius: 2px; pointer-events: none;
  white-space: nowrap; overflow: hidden;
}

/* Sin zoom de la página entera con los dedos (sí se puede desplazar). El
   pellizco del gráfico lo maneja el propio gráfico. */
html, body { touch-action: pan-x pan-y; }

/* Botón de plegar la barra de herramientas siempre a la vista. En el móvil la
   barra no cabe de alto y se desplaza, y el botón (el último) quedaba oculto
   abajo. Ahora se queda fijo al pie de la barra. */
#drawToolbar #btnPlegarBarra {
  position: sticky; bottom: 0; z-index: 1; flex-shrink: 0;
  background: #000000;
}
@media (max-width: 768px), (hover: none) and (max-width: 1366px), (pointer: coarse) and (max-width: 1366px) {
  #drawToolbar #btnPlegarBarra { background: rgb(0, 0, 0); border-top: 1px solid var(--line); }
}
[data-theme="light"] #drawToolbar #btnPlegarBarra { background: #ffffff; }

/* Whale Orders: lista de órdenes grandes, junto a la escala de precios. */
#whaleLista { position: absolute; top: 8px; z-index: 7; width: 230px; max-height: 55%; display: flex; flex-direction: column;
  background: rgba(11,14,17,.55); border: 1px solid rgba(42,46,57,.8); border-radius: 6px; font: 11px var(--mono, monospace); color: #d1d4dc;
  text-shadow: 0 0 2px #000, 0 0 2px #000; }
#whaleLista .wl-cab { display: flex; align-items: center; gap: 6px; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid #2a2e39; user-select: none; }
#whaleLista .wl-n { color: #8b90a0; }
#whaleLista .wl-plegar { margin-left: auto; color: #8b90a0; }
#whaleLista .wl-filas { overflow-y: auto; position: relative; }
#whaleLista .wl-fila { display: grid; grid-template-columns: 1fr 58px 52px; gap: 4px; padding: 2px 6px; align-items: center; }
#whaleLista .wl-ex { font-weight: 700; }
#whaleLista .wl-usd { text-align: right; font-weight: 700; }
#whaleLista .wl-edad { text-align: right; color: #8b90a0; }
#whaleLista .wl-vacio { padding: 8px; color: #8b90a0; }
@media (max-width: 700px) { #whaleLista { width: 190px; max-height: 40%; font-size: 10px; } }

/* Deshacer / Rehacer dibujos: solo en el PC (en el móvil no se muestran). */
#deshacerWrap { display: flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 8px; border-left: 1px solid #3a3f47; }
#deshacerWrap .btn { padding: 4px 8px; display: inline-flex; align-items: center; }
#deshacerWrap .btn.inactivo { opacity: .35; pointer-events: none; }
@media (max-width: 768px), (pointer: coarse) { #deshacerWrap { display: none; } }

/* Aislado / Cruzado en el panel de trading */
#panelTrading .tr-margen .tr-margen-b { flex: 1; font-size: 11px; padding: 3px 0; }
#panelTrading .tr-margen .tr-margen-b.activo { background: var(--accent); color: #0b0e11; }

/* Datos de usuarios ocultos: el campo del apodo también sale con puntos */
.datos-ocultos input[data-apodo-input] { -webkit-text-security: disc; }

/* Texto tapado con puntos sin ser un campo de contraseña (enlace de soporte) */
.texto-oculto { -webkit-text-security: disc; }

/* Fuerza: "Volatilidad alta" y "Volatilidad extrema" parpadean suavemente,
   igual que el CHoCH (se aclara y se oscurece, sin llegar a desaparecer). */
@keyframes parpadeoSuave { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.fp-volatilidad.v-alta, .fp-volatilidad.v-extrema { animation: parpadeoSuave 1.4s ease-in-out infinite; }

/* ---- Lista de indicadores en ventana, con el diseño de la configuración ---- */
#indModal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 299;
  display: flex; align-items: center; justify-content: center; }
#indModal.hidden { display: none; }
#indModal .cfg-box.estilo-tv { width: min(440px, calc(100vw - 24px)); }
#indModal .cfg-header #indClose { font-size: 20px; color: #bdbdbd; cursor: pointer; }
.cfg-box.estilo-tv #indFields { padding: 6px 22px 10px; margin: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #6b6c71 transparent; }
.cfg-box.estilo-tv #indFields::-webkit-scrollbar { width: 8px; }
.cfg-box.estilo-tv #indFields::-webkit-scrollbar-thumb { background: #6b6c71; border-radius: 4px; }
#indFields .tv-fila.ind-fila { margin-bottom: 8px; cursor: pointer; }
#indFields .ind-fila .tv-et { flex: 1 1 auto; }
#indFields .ind-fila.activo .tv-et { color: #f0b90b; }
#indFields .ind-fav, #indFields .ind-cfg { width: 22px; text-align: center; font-size: 16px; color: #8b8c91; cursor: pointer; flex: 0 0 22px; }
#indFields .ind-fav.si { color: #f0b90b; }
#indFields .ind-pestanas { display: flex; align-items: center; justify-content: space-between; }
#indFields .ind-pestana { border: 1px solid #4a4b50; border-radius: 6px; padding: 4px 10px; color: #9a9ba0;
  letter-spacing: .4px; cursor: pointer; user-select: none; }
#indFields .ind-pestana:hover { border-color: #8b8c91; color: #ffffff; }
#indFields .ind-pestana.activa { border-color: #f0b90b; color: #f0b90b; }
#indFields .ind-fav:hover, #indFields .ind-cfg:hover { color: #ffffff; }
@media (max-width: 600px) {
  #indModal { align-items: stretch; justify-content: stretch; background: #1f2023; }
  #indModal .cfg-box.estilo-tv { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  #indModal .cfg-header { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; }
  #indModal .cfg-header #indClose { font-size: 24px; padding: 4px 6px; margin-right: -6px; }
  .cfg-box.estilo-tv #indFields { padding: 2px 16px 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  #indFields .tv-fila.ind-fila { min-height: 42px; font-size: 15px; }
  #indFields .ind-fav, #indFields .ind-cfg { font-size: 20px; width: 30px; flex-basis: 30px; }
}
#indModal:not(.hidden) ~ #marcaOroFija { display: none; }

/* Pantalla 2 (con dos pantallas): Fuerza y Delta buy and sell abajo a la
   derecha y el Delta Spot abajo a la izquierda, igual que en la principal. */
.ge-smcpanels {
  position: absolute; right: 12px; bottom: 12px; z-index: 6;
  display: flex; flex-direction: row; align-items: flex-end; gap: 8px;
  pointer-events: none; transform: scale(0.72); transform-origin: bottom right;
}
.ge-izq {
  position: absolute; left: 0; bottom: 12px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; transform: scale(0.72); transform-origin: bottom left;
}
.ge-smcpanels > *, .ge-izq > * { pointer-events: auto; }
.ge-smcpanels > .hidden, .ge-izq > .hidden { display: none; }
@media (max-width: 768px) {
  .ge-smcpanels { transform: scale(0.55); }
  .ge-izq { transform: scale(0.55); }
}

/* Botón de indicadores de cada pantalla dividida y su lista. */
.grafico-extra { position: relative; }
.ge-ind { display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: #ffffff; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.ge-ind:hover { border-color: var(--text-dim); }
.ge-ind svg { display: block; }
.ge-ind-lista { position: absolute; z-index: 30; max-height: 70%; overflow-y: auto; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); font-family: var(--mono); font-size: 12px; }
.ge-ind-lista.hidden { display: none; }
.ge-ind-fila { display: flex; align-items: center; gap: 8px; padding: 5px 12px; cursor: pointer; color: var(--text); white-space: nowrap; }
.ge-ind-fila:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .ge-ind { color: #1a1d23; }

/* Replicar el par (pantallas 2 y 4) */
.ge-replicar { display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-dim); padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.ge-replicar:hover { border-color: var(--text-dim); color: var(--text); }
.ge-replicar.activo { color: #0b0e11; background: var(--accent, #f0b90b); border-color: var(--accent, #f0b90b); }
.ge-replicar svg { display: block; }

/* Aviso repetido de hackeo o quiebra: parpadea. */
#avisoAlerta.parpadeo { animation: avisoParpadeo 0.8s ease-in-out infinite; }
@keyframes avisoParpadeo { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,83,80,0.0); } 50% { opacity: 0.35; box-shadow: 0 0 18px 4px rgba(239,83,80,0.7); } }
#avisoAlerta.parpadeo-verde { animation: avisoParpadeoVerde 0.8s ease-in-out infinite; }
@keyframes avisoParpadeoVerde { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,200,83,0.0); } 50% { opacity: 0.35; box-shadow: 0 0 18px 4px rgba(0,200,83,0.7); } }

/* Figuras propias de las imágenes de compartir (panel de administración) */
.fig-ex { border: 1px solid var(--line, #2a2f36); border-radius: 6px; padding: 8px; margin: 10px 0; }
.fig-ex-t { font-weight: 600; margin-bottom: 6px; }
.fig-grupo { margin: 6px 0 10px; }
.fig-grupo-t { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted, #8b939c); margin-bottom: 6px; }
.fig-subir { padding: 3px 8px; font-size: 12px; cursor: pointer; }
.fig-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.fig-item { position: relative; width: 64px; height: 64px; border-radius: 6px; background: #0d1117; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fig-item img { max-width: 100%; max-height: 100%; }
.fig-item button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,0.7); color: #fff; font-size: 11px; cursor: pointer; line-height: 20px; }
.fig-vacio { font-size: 11px; color: var(--muted, #8b939c); }

/* Botón 🔊 del asistente: lee el resumen del análisis en voz alta */
.asis-voz { display: inline-block; margin: 6px 0 0 0; padding: 2px 10px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.asis-voz.activo { border-color: var(--accent, #f0b90b); }
