/* SpaceView — estilos
   Disposición: barra superior · herramientas a la izquierda · gráfico protagonista · lista a la derecha.
   En celular: gráfico a pantalla completa, barra inferior y paneles como hojas deslizables. */

/* Tipografía: Geist (interfaz) y Geist Mono (precios, porcentajes, volumen, P&L, ejes y estadísticas).
   OFL, libres. Incluidas en la app (fonts/) para que se vean igual en todos los dispositivos y sin conexión.
   La versión mono hace que todos los números ocupen el mismo ancho y queden alineados en columna. */
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* paleta fría: azul profundo + violeta como acento (sin amarillos) */
  --bg: #0a0d14; --panel: #0f131c; --raise: #161b27; --hover: #1c2231; --line: #212838;
  --fg: #e3e8f2; --muted: #8b94a8; --faint: #586176;
  --accent: #6f8cff; --accent2: #a487ff; --accent-deep: #3a4ab0; --accent-ink: #ffffff; --accent-soft: rgba(111,140,255,.14);
  --grad: linear-gradient(135deg, #5b7cff 0%, #8f6bff 100%);
  --up: #22ab94; --down: #f04d5e; --warn: #d6a24e; --info: #5ea4ff;
  --candle-up: #089981; --candle-down: #B6121F;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --code: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px; --top-h: 46px; --side-w: 320px;
  --shadow: 0 18px 50px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7fb; --panel: #ffffff; --raise: #eef0f7; --hover: #e5e8f2; --line: #dde1ec;
  --fg: #151b2b; --muted: #5c6680; --faint: #97a0b5;
  --accent: #4562e8; --accent2: #7b55e6; --accent-deep: #3347b8; --accent-ink: #ffffff; --accent-soft: rgba(69,98,232,.11);
  --grad: linear-gradient(135deg, #4562e8 0%, #7b55e6 100%);
  --up: #089981; --down: #e0364a; --warn: #a8740f; --info: #2c6fd6;
  --candle-up: #089981; --candle-down: #B6121F;
  --shadow: 0 18px 50px rgba(20,30,60,.18), 0 2px 8px rgba(20,30,60,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 500 14px/1.4 var(--font); font-feature-settings: "tnum" 0; overflow: hidden; -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.muted { color: var(--muted); }
.grow { flex: 1; }

.app { display: grid; grid-template-rows: var(--top-h) 1fr auto; height: 100%; }

/* ---------- barra superior ---------- */
.top { display: flex; align-items: center; gap: 6px; padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px));
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 17px; letter-spacing: .02em; margin-right: 6px; white-space: nowrap; }
.brand img { border-radius: 5px; }
.sym-btn { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: var(--r); background: var(--raise); white-space: nowrap; min-width: 0; }
.sym-btn:hover { background: var(--hover); }
.sym-btn b { font-size: 15.5px; letter-spacing: .02em; }
.sym-ic { color: var(--muted); display: flex; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--hover); color: var(--muted); letter-spacing: .03em; }
.badge.m-crypto { color: #b59bff; } .badge.m-byma { color: #6cb4ff; } .badge.m-us { color: #7fd0c0; }
.tfs { display: flex; gap: 1px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tfs::-webkit-scrollbar { display: none; }
.tf { height: 30px; padding: 0 9px; border-radius: var(--r); color: var(--muted); white-space: nowrap; font-size: 14.5px; }
.tf:hover { color: var(--fg); background: var(--raise); }
.tf[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.tf:disabled { opacity: .35; cursor: not-allowed; }
.ind-btn { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 9px; border-radius: var(--r); margin-left: 4px;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); font-weight: 700; white-space: nowrap; }
.ind-btn:hover { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.ind-btn span:first-child { display: flex; }
.spacer { flex: 1; }
.feed { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border-radius: 99px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.feed:hover { background: var(--raise); }
.feed i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.feed[data-s="ok"] i { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 22%, transparent); }
.feed[data-s="delayed"] i { background: var(--warn); }
.feed[data-s="error"] i, .feed[data-s="proxy"] i, .feed[data-s="limited"] i { background: var(--down); }
.top-icons { display: flex; gap: 2px; }

/* ---------- botones ---------- */
.ib { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r); color: var(--muted); flex: none; font-size: 20px; line-height: 1; }
.ib:hover { color: var(--fg); background: var(--raise); }
.ib.sm { width: 22px; height: 22px; border-radius: 4px; }
.ib.acc { color: var(--accent); }
.ib[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.ib:disabled { opacity: .35; cursor: default; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--r);
  background: var(--raise); border: 1px solid var(--line); font-weight: 600; }
.btn:hover { border-color: var(--muted); }
.btn.pri { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.btn.pri:hover { filter: brightness(1.08); }
.btn.danger { background: var(--down); color: #fff; border-color: transparent; }
.btn.wide { width: 100%; }
.link { color: var(--accent); padding: 10px 16px 0; font-weight: 600; }

/* ---------- cuerpo ---------- */
.main { display: grid; grid-template-columns: 44px 1fr var(--side-w) 44px; min-height: 0; }
.app.no-side .main { grid-template-columns: 44px 1fr 0 44px; }
.app.no-side .side { display: none; }

/* herramientas de dibujo */
.tools { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tools .sep { width: 24px; height: 1px; background: var(--line); margin: 4px 0; flex: none; }
.tools .ib { width: 34px; height: 34px; }

/* gráfico */
.chart-area { position: relative; min-width: 0; min-height: 0; isolation: isolate; display: flex; flex-direction: column; } /* los separadores de paneles de la librería usan z-index 50: quedan contenidos aquí */
.chart-host { position: absolute; inset: 0; touch-action: none; }
.chart-canvas { position: absolute; inset: 0; }
.chart-host[data-tool]:not([data-tool="cursor"]) { cursor: crosshair; }
.chart-host[data-tool="eraser"] { cursor: not-allowed; }
.chart-host.over-drawing { cursor: pointer; }
.chart-host.over-handle { cursor: grab; }
.legends { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.pleg { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; gap: 1px; will-change: transform; }
.phead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; font-size: 13px; margin-bottom: 2px; }
.phead .lsym { font-size: 15px; }
.ohlc i { font-style: normal; color: var(--muted); margin-right: 3px; }
.lrow { display: flex; align-items: center; gap: 7px; font-size: 13px; width: max-content; max-width: 100%; pointer-events: auto; padding: 1px 6px; margin-left: -6px; border-radius: 4px; cursor: default; }
.lrow:hover, .lrow.show-acts { background: color-mix(in srgb, var(--panel) 88%, transparent); }
.lrow .lname { color: var(--muted); white-space: nowrap; }
.lrow .lvals { display: flex; gap: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.lrow .lacts { display: none; gap: 1px; }
.lrow:hover .lacts, .lrow.show-acts .lacts, .lrow:focus-within .lacts { display: flex; }
.lrow.off { opacity: .5; }
.lrow .lerr.st { color: var(--muted); font-style: italic; }
.lrow .lerr { color: var(--down); font-size: 12px; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pleg.collapsed .lrow::after { content: "doble clic para mostrar"; color: var(--faint); font-size: 11px; margin-left: 6px; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; background: color-mix(in srgb, var(--bg) 72%, transparent); text-align: center; padding: 24px; }
.overlay > div { max-width: 46ch; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.overlay strong { color: var(--fg); font-size: 17px; }
.overlay .btn { margin: 6px auto 0; }

/* barra de estilo del dibujo seleccionado */
.dstyle { position: absolute; top: 8px; right: 84px; z-index: 7; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.dstyle .sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; }
.dstyle .sw[aria-pressed="true"] { border-color: var(--fg); }
.dstyle .vsep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.tool-chip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px;
  border-radius: 99px; background: var(--panel); border: 1px solid var(--accent); font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.3); white-space: nowrap; }

/* panel lateral */
.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.side-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); }
.side-tabs [role="tab"] { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.side-tabs [role="tab"][aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.side-close { display: none; }
.side-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.side-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 10px; }
.ibs { display: flex; gap: 1px; }
.list-sel { flex: 1; min-width: 0; height: 32px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); padding: 0 8px; font-weight: 700; }
.side-cols, .row { display: grid; grid-template-columns: 18px minmax(0,1fr) auto 66px 24px; gap: 6px; align-items: center; }
.side-cols { padding: 4px 8px 6px 6px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.side-cols span:nth-child(3), .side-cols span:nth-child(4) { text-align: right; }
.wl { overflow-y: auto; flex: 1; min-height: 0; position: relative; overscroll-behavior: contain; }
.row { padding: 7px 8px 7px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); cursor: pointer; background: var(--panel); user-select: none; -webkit-user-select: none; position: relative; }
.row:hover { background: var(--raise); }
.row[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.row .grip { color: var(--faint); display: grid; place-items: center; cursor: grab; touch-action: none; height: 28px; }
.row:hover .grip { color: var(--muted); }
.row .s { display: flex; flex-direction: column; min-width: 0; }
.row .s b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s small { font-size: 11.5px; color: var(--muted); }
.row .p { text-align: right; font-size: 14.5px; }
.chg { text-align: right; font-size: 13px; padding: 2px 5px; border-radius: 4px; }
.chg.up { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.chg.dn { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
.row .rm { width: 24px; height: 24px; opacity: 0; }
.row:hover .rm, .row:focus-within .rm { opacity: 1; }
.row .rm:hover { color: var(--down); }
.wl.sorting .row { transition: transform .14s ease; }
.row.dragging { z-index: 5; transition: none !important; box-shadow: 0 8px 22px rgba(0,0,0,.35); background: var(--hover); cursor: grabbing; }
.empty { padding: 28px 18px; color: var(--fg); text-align: center; }
.empty p { margin: 4px 0; }
.side-foot { padding: 10px; border-top: 1px solid var(--line); }
.info { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.info h3 { margin: 0; font-size: 19px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.feeds { display: flex; flex-direction: column; gap: 6px; }
.feeds div { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
.feeds i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); transform: translateY(-1px); }
.feeds [data-s="ok"] i { background: var(--up); } .feeds [data-s="delayed"] i { background: var(--warn); }
.feeds [data-s="error"] i, .feeds [data-s="proxy"] i, .feeds [data-s="limited"] i { background: var(--down); }

/* riel derecho */
.rail { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; background: var(--panel); border-left: 1px solid var(--line); }
.rail .ib { width: 34px; height: 34px; }

/* barra inferior (celular) */
.bnav { display: none; }

/* ---------- diálogos ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(4,6,14,.58); backdrop-filter: blur(2px);
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(560px, 100%); max-height: min(760px, 100%); display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow); }
.sheet.wide { width: min(760px, 100%); }
.sheet.small { width: min(400px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 19px; flex: 1; }
.sheet-pad { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet-body { overflow-y: auto; min-height: 0; flex: 1; padding-bottom: 12px; overscroll-behavior: contain; }
.search, .inp { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raise); }
.search { font-size: 16px; text-transform: uppercase; }
.search::placeholder { text-transform: none; color: var(--muted); }
.mkts { display: flex; gap: 6px; padding: 0 16px 10px; flex-wrap: wrap; }
.mkt { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 14px; }
.mkt[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.res { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.res:hover { background: var(--raise); }
.res .open { text-align: left; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.res .rt { display: flex; align-items: center; gap: 7px; }
.res .open small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res .p { font-size: 14px; color: var(--muted); }
.add { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); }
.add:hover { color: var(--accent); border-color: var(--accent); }
.add[aria-pressed="true"] { color: var(--up); border-color: transparent; }
.hint { padding: 16px; color: var(--muted); }
.notice { display: flex; gap: 8px; align-items: flex-start; margin: 8px 16px; padding: 9px 11px; border-radius: var(--r); font-size: 14px; background: var(--raise); }
.notice svg { flex: none; margin-top: 2px; }
.notice.warn { color: var(--warn); } .notice.err { color: var(--down); }
.notice span { color: var(--fg); }
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { padding: 10px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs [role="tab"][aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.sec-title { padding: 14px 16px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 16px; }
.cat-item { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raise); display: flex; flex-direction: column; gap: 2px; }
.cat-item:hover { border-color: var(--accent); }
.cat-item small { color: var(--muted); font-size: 12.5px; }
.plist { display: flex; flex-direction: column; gap: 6px; padding: 0 16px; }
.pitem, .aitem { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.aitem { margin: 0 16px 6px; }
.aitem.off { opacity: .55; }
.pname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pname small { color: var(--muted); font-size: 12.5px; }
.pname .err { color: var(--down); }
.empty-box { padding: 16px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; }
.empty-box p { margin: 4px 0; }
.row-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 0; }
.row-acts.end { justify-content: flex-end; padding: 0; }
.sheet-pad .row-acts { padding: 0; }
.editor { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
/* el editor de código usa monoespaciada: en Pine la sangría define bloques y en una fuente proporcional no se ve alineada */
.code { width: 100%; min-height: 300px; height: 42vh; resize: vertical; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg);
  font: 13px/1.5 var(--code); tab-size: 4; white-space: pre; overflow: auto; }
.ebar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.emsg { font-size: 14px; color: var(--muted); min-height: 1.3em; }
.emsg.err { color: var(--down); } .emsg.ok { color: var(--up); }
.iform { display: flex; flex-direction: column; gap: 2px; padding: 0 16px; }
.igroup { margin-top: 12px; padding-bottom: 4px; font-weight: 700; border-bottom: 1px solid var(--line); }
.ifield { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px, 200px); gap: 10px; align-items: center; padding: 6px 0; }
.ifield > span:first-child { color: var(--fg); }
.ifield.chk { grid-template-columns: minmax(0,1fr) auto; }
.ifield input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.ifield .inp { height: 34px; }
.cpick { display: flex; align-items: center; gap: 6px; }
.cpick input[type="color"] { width: 38px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; }
.cpick .inp { width: 64px; padding: 0 6px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 12px 16px; }
.tool-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; text-align: center; }
.tool-grid button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.set-sec { padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.set-sec h3 { margin: 10px 0 0; font-size: 16px; }
.set-sec p { margin: 0; color: var(--muted); font-size: 14px; }
.set-sec ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.set-sec code { font-family: var(--code); font-size: 12.5px; background: var(--raise); padding: 1px 4px; border-radius: 3px; word-break: break-all; }
.inline { display: flex; gap: 6px; }

/* avisos y tooltips */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--fg); color: var(--bg);
  padding: 8px 16px; border-radius: 99px; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100% - 32px); text-align: center; }
.toast[data-kind="err"] { background: var(--down); color: #fff; }
.tip { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; background: var(--fg); color: var(--bg); padding: 5px 9px; border-radius: 5px; font-size: 13px;
  max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }


/* ============ v2.1: componentes nuevos ============ */
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--raise); }
.btn.sm { min-height: 28px; padding: 0 9px; font-size: 13.5px; }
.link.sm { padding: 0 4px; font-size: 13px; font-weight: 600; }
.small { font-size: 13px; }
.err { color: var(--down); }
.type-btn { color: var(--fg); }

/* menú emergente (tipo de gráfico, grupos de herramientas, imán) */
.menu { position: fixed; z-index: 55; min-width: 220px; max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .12s ease-out; }
.menu-t { padding: 6px 10px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.menu-h { padding: 8px 10px 2px; font-size: 12px; color: var(--faint); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 6px; text-align: left; color: var(--fg); font-size: 14.5px; }
.menu-i:hover, .menu-i:focus-visible { background: var(--raise); outline: none; }
.menu-i[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }
.menu-i svg { flex: none; }
.menu-i span { flex: 1; }
.menu-i kbd { font: 11.5px var(--code); color: var(--faint); }
@keyframes pop { from { opacity: 0; transform: translateY(-3px) scale(.985); } to { opacity: 1; transform: none; } }

/* barra de herramientas con grupos */
.tools .ib.grp, .tools .ib.mag { position: relative; }
.tools .ib.grp::after, .tools .ib.mag::after { content: ""; position: absolute; right: 3px; bottom: 3px; border: 3px solid transparent; border-right-color: var(--faint); border-bottom-color: var(--faint); opacity: .8; }
.tools .ib.grp:hover::after, .tools .ib.mag:hover::after { border-right-color: var(--fg); border-bottom-color: var(--fg); }
.tools .ib.mag[data-mode="strong"] { color: var(--accent2); background: color-mix(in srgb, var(--accent2) 16%, transparent); }
.tool-chip { gap: 10px; }
.tool-chip small { font-size: 12px; }
.hchips { display: inline-flex; gap: 5px; pointer-events: auto; }
.hchip { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--raise); color: var(--muted); border: 1px solid var(--line); cursor: default; white-space: nowrap; }
.hchip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.hchip.acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); cursor: pointer; }

/* barra de estilo del dibujo */
.dstyle { gap: 5px; padding: 5px 6px; flex-wrap: wrap; max-width: calc(100% - 120px); }
.dstyle .dname { font-size: 12.5px; color: var(--muted); padding: 0 4px 0 2px; white-space: nowrap; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.dstyle .inp.sm { height: 28px; width: auto; padding: 0 6px; font-size: 13px; }
.ib.flip svg { transform: scaleX(-1); }
.ib .chev, .ib svg { pointer-events: none; }

/* selector de color */
.cbtn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); flex: none; position: relative; overflow: hidden;
  background: conic-gradient(#8885 25%, transparent 0 50%, #8885 0 75%, transparent 0) 0 0 / 8px 8px; }
.cbtn::after { content: ""; position: absolute; inset: 0; background: var(--c); }
.cbtn:hover { border-color: var(--muted); }
.cpop { position: fixed; z-index: 60; width: 248px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px; animation: pop .12s ease-out; }
.cp-sv { position: relative; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue)); }
.cp-sv i { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); pointer-events: none; }
.cp-hue, .cp-alpha { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 99px; margin: 0; }
.cp-hue { background: linear-gradient(to right, red, #ff0, lime, cyan, blue, #f0f, red); }
.cp-alpha { background: linear-gradient(to right, transparent, var(--solid)), conic-gradient(#8886 25%, transparent 0 50%, #8886 0 75%, transparent 0) 0 0 / 8px 8px; }
.cp-hue::-webkit-slider-thumb, .cp-alpha::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.35); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cp-hue::-moz-range-thumb, .cp-alpha::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.35); }
.cp-row { display: flex; align-items: center; gap: 8px; }
.cp-prev { width: 30px; height: 30px; border-radius: 6px; flex: none; position: relative; overflow: hidden; border: 1px solid var(--line);
  background: conic-gradient(#8885 25%, transparent 0 50%, #8885 0 75%, transparent 0) 0 0 / 8px 8px; }
.cp-prev::after { content: ""; position: absolute; inset: 0; background: var(--c); }
.cp-hex { height: 30px; font: 13px var(--code); text-transform: uppercase; }
.cp-pct { font-size: 13px; color: var(--muted); width: 40px; text-align: right; }
.cp-sw { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.cp-s { aspect-ratio: 1; border-radius: 5px; position: relative; overflow: hidden; border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent); }
.cp-s::after { content: ""; position: absolute; inset: 0; background: var(--c); }
.cp-s.recent { border-radius: 50%; }
.cp-s:hover { transform: scale(1.12); }

/* configuración (indicadores y gráfico) */
.modal.in .sheet.set { animation: sheetIn .18s cubic-bezier(.2,.8,.3,1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.sheet.set { max-height: min(780px, 100%); }
.sheet-head .ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet-head .ttl h2 { font-size: 18.5px; flex: none; }
.sheet-head .ttl small { font-size: 12.5px; }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.sbody { padding: 4px 16px 16px; }
.fade { animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.sset { padding: 10px 0 4px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.sset:last-child { border-bottom: 0; }
.sset h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 700; }
.frow { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px, 240px); gap: 12px; align-items: center; padding: 6px 0; }
.frow > label { color: var(--fg); }
.frow .inp { height: 34px; }
.frow textarea.inp { height: auto; padding: 8px 10px; font: 13px/1.4 var(--code); }
.frow.chk { grid-template-columns: auto minmax(0,1fr); }
.frow.chk .help { grid-column: 2; margin-top: -4px; line-height: 1.35; }
.frow .ctl { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.frow .ctl .inp { width: auto; min-width: 70px; flex: 1 1 90px; }
.frow .ctl small { font-size: 12.5px; }
.frow .ctl label.sub { font-size: 13px; }
.frow.chk.inl { grid-template-columns: auto minmax(0,1fr) auto; }
.inline-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-row > .frow { flex: 1 1 200px; }
.switch { -webkit-appearance: none; appearance: none; width: 34px; height: 20px; border-radius: 99px; background: var(--hover); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch:checked { background: var(--accent); border-color: transparent; }
.switch:checked::after { transform: translateX(14px); background: #fff; }
.srow { display: grid; grid-template-columns: auto minmax(90px, 1fr) 48px auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.srow:last-child { border-bottom: 0; }
.srow input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.srow.off .slab, .srow.off .sprev, .srow.off .sctr { opacity: .45; }
.sprev { display: flex; }
.sctr { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sctr .inp.sm { height: 28px; width: auto; padding: 0 6px; font-size: 13px; }
.range { width: 86px; accent-color: var(--accent); }
.set-note { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; align-items: flex-start; }
.set-wrap { display: grid; grid-template-columns: 180px 1fr; min-height: 0; flex: 1; }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-right: 1px solid var(--line); }
.set-nav button { text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.set-nav button:hover { background: var(--raise); color: var(--fg); }
.set-nav button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.type-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 7px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; text-align: center; }
.type-item:hover { border-color: var(--muted); }
.type-item[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pending { margin-top: 8px; }
.pending p { margin: 4px 0; line-height: 1.4; }
.pending b { color: var(--fg); font-weight: 600; }

/* escala y paneles ocultos */
.scalebar { position: absolute; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 1px; pointer-events: none; background: var(--bg); }
.sbtn { pointer-events: auto; min-width: 19px; height: 20px; padding: 0 3px; border-radius: 4px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid transparent; }
.sbtn:hover { color: var(--fg); border-color: var(--line); }
.sbtn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.ptray { position: absolute; z-index: 4; display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.pchip { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.pchip:hover { color: var(--accent); border-color: var(--accent); }
.oacts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.oacts .btn { margin: 0; }

/* lista: ancho ajustable, secciones e información integrada */
.side-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; touch-action: none; }
.side-resize::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.side-resize:hover::after, body.resizing .side-resize::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .chart-area { pointer-events: none; }
.row.sec { grid-template-columns: 18px 14px minmax(0,1fr) auto 24px 24px; padding: 6px 8px 5px 6px; background: color-mix(in srgb, var(--raise) 55%, var(--panel)); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.row.sec .s b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.row.sec .chev { display: flex; color: var(--muted); transition: transform .15s; }
.row.sec.closed .chev { transform: rotate(-90deg); }
.row.sec .cnt { font-size: 12px; color: var(--faint); }
.row.sec .rm { opacity: 0; }
.row.sec:hover .rm { opacity: 1; }
.wl-info { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--raise) 40%, var(--panel)); padding: 6px 10px 8px; flex: none; }
.wi-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 0; }
.wi-head b { font-size: 15px; }
.wi-head .chev { display: flex; color: var(--muted); transition: transform .15s; }
.wl-info.closed .wi-head .chev { transform: rotate(180deg); }
.wi-st { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.wi-st.ok { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.wi-main { display: flex; align-items: baseline; gap: 8px; padding: 2px 0 4px; flex-wrap: wrap; }
.wi-px { font-size: 22px; font-weight: 700; }
.wi-ch.up { color: var(--up); } .wi-ch.dn { color: var(--down); }
.wi-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 3px 10px; margin: 2px 0 0; font-size: 13px; }
.wi-grid dt { color: var(--muted); } .wi-grid dd { margin: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi-note { display: block; margin-top: 5px; font-size: 11.5px; line-height: 1.3; }
.ih { display: flex; align-items: center; gap: 8px; }
.isec .sec-title { padding: 0 0 6px; }
.isec p { margin: 4px 0; font-size: 13.5px; }
.ev { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; }
.ev a { color: var(--accent); font-size: 13px; }
.ev.cand { border-style: dashed; }
.ev .btn { align-self: flex-start; margin-top: 4px; }
.pxst { padding: 9px 11px; border-radius: 8px; background: var(--raise); }
.pxst.ok { color: var(--up) !important; }
/* herramientas en celular */
.tg-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 6px 10px; font-size: 13.5px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }


/* ============ v2.2: multi-gráfico, vistas, editor, trading ============ */
.views { display: flex; gap: 2px; margin-right: 6px; padding: 2px; border-radius: 9px; background: var(--raise); }
.view-btn { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.view-btn:hover { color: var(--fg); }
.view-btn[aria-pressed="true"] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.view-btn[aria-pressed="true"] svg { color: var(--accent); }
@media (max-width: 1640px) { .view-btn span { display: none; } .view-btn { padding: 0 8px; } }
@media (max-width: 1280px) { .brand span { display: none; } .feed span { display: none; } }
.chart-ctl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.app:not([data-view="chart"]) .chart-ctl, .app:not([data-view="chart"]) .feed { display: none; }
.view { min-height: 0; min-width: 0; overflow: hidden; background: var(--bg); }
.charts { flex: 1; min-height: 0; display: grid; gap: 0; }
.charts.multi { gap: 3px; background: var(--line); }
.cell { position: relative; min-width: 0; min-height: 0; background: var(--bg); }
.cell > .chart-host { position: absolute; inset: 0; }
.charts.multi .cell.active { box-shadow: inset 0 0 0 1px var(--accent); z-index: 1; }
.charts.multi .cell.active::after { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--grad); pointer-events: none; z-index: 8; }
.cell-bar { position: absolute; top: 4px; right: 76px; z-index: 7; display: none; gap: 2px; padding: 2px; border-radius: 7px; background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line); }
.charts.multi .cell:hover .cell-bar { display: flex; }
.chart-host.picking { cursor: col-resize; }
.pick-line { position: absolute; top: 0; bottom: 28px; width: 0; border-left: 2px dashed var(--accent2); pointer-events: none; z-index: 6; }
.delta-card { position: absolute; z-index: 9; min-width: 210px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; animation: pop .12s ease-out; }
.delta-card b { display: block; margin-bottom: 6px; }
.delta-card p { margin: 0; max-width: 260px; }
.delta-card .kv { gap: 3px 14px; font-size: 13px; }
.delta-card small { display: block; margin-top: 6px; font-size: 11.5px; }
.kv dd.up, .up { color: var(--up); } .kv dd.dn, .dn { color: var(--down); }
.ohlc.delta.up span { color: var(--up); } .ohlc.delta.dn span { color: var(--down); }
.replay-bar { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 9; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--accent); box-shadow: var(--shadow); white-space: nowrap; }
.replay-bar .inp.sm { height: 28px; width: auto; }
.replay-bar .num { font-size: 12.5px; }
/* editor acoplado */
.dock { flex: none; position: relative; border-top: 1px solid var(--line); background: var(--panel); min-height: 140px; display: flex; flex-direction: column; }
.dock-resize { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: row-resize; z-index: 3; }
.dock-resize:hover { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ide { display: flex; flex-direction: column; min-height: 0; height: 100%; flex: 1; background: var(--panel); }
#vCode .ide { height: 100%; }
.ide-bar { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ide-bar .ide-sel { width: auto; max-width: 280px; height: 30px; font-weight: 600; }
.ide-bar .vsep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.ide-bar .btn.sm { min-height: 30px; }
.ide-bar [aria-pressed="true"] svg { fill: currentColor; fill-opacity: .25; }
.ide-favs { display: flex; gap: 5px; padding: 5px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; align-items: center; }
.fchip { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; color: var(--muted); }
.fchip:hover { color: var(--fg); border-color: var(--muted); } .fchip.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.ide-code { flex: 1; min-height: 0; overflow: hidden; }
.ide-code .cm-editor { height: 100%; background: var(--bg); color: var(--fg); }
.ide-code .cm-scroller { font-family: var(--code); line-height: 1.55; }
.ide-code .cm-gutters { background: var(--panel); color: var(--faint); border-right: 1px solid var(--line); }
.ide-code .cm-activeLine { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ide-code .cm-activeLineGutter { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--fg); }
.ide-code .cm-cursor { border-left-color: var(--accent); }
.ide-code .cm-selectionBackground, .ide-code .cm-focused .cm-selectionBackground { background: color-mix(in srgb, var(--accent) 30%, transparent) !important; }
.ide-code .cm-panels { background: var(--panel); color: var(--fg); border-color: var(--line); }
.ide-code .cm-panels input, .ide-code .cm-panels button { font: inherit; font-size: 13px; background: var(--raise); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.ide-code .cm-searchMatch { background: color-mix(in srgb, var(--warn) 30%, transparent); }
.ide-code .cm-tooltip { background: var(--panel); border: 1px solid var(--line); color: var(--fg); }
.ide-code .cm-tooltip-autocomplete ul li[aria-selected] { background: var(--accent-soft); color: var(--fg); }
.ide-status { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-size: 12.5px; border-top: 1px solid var(--line); min-height: 26px; }
.ide-status.ok .grow { color: var(--up); } .ide-status.err .grow { color: var(--down); } .ide-status.run .grow { color: var(--accent); }
.ide-status .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root { --ed-comment: #6a7590; --ed-meta: #8b94a8; --ed-string: #7fd0a5; --ed-number: #f2b178; --ed-keyword: #b49bff; --ed-type: #6cc4ff; --ed-ns: #8ea2ff; --ed-atom: #f0839a; --ed-fn: #ffd36e; --ed-op: #9aa6bf; }
:root[data-theme="light"] { --ed-comment: #8a93a6; --ed-meta: #6b7385; --ed-string: #19804f; --ed-number: #b5530e; --ed-keyword: #6a3fd1; --ed-type: #0b6bb3; --ed-ns: #3d55d6; --ed-atom: #c0284f; --ed-fn: #9a6400; --ed-op: #5b6578; }
/* ventanas flotantes: no bloquean el gráfico */
.modal.float { background: none; backdrop-filter: none; pointer-events: none; display: block; padding: 0; }
.modal.float .sheet { pointer-events: auto; position: fixed; width: min(560px, calc(100vw - 16px)); max-height: min(78vh, 760px); }
.modal.float .sheet-head { cursor: move; user-select: none; }
.modal.float .sheet.dragging { opacity: .92; }
/* estrategias y NRM */
#vStrat, #vNrm { display: grid; grid-template-rows: auto 1fr; }
#vStrat { grid-template-columns: 340px 1fr; grid-template-rows: 1fr; }
.sv-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.sv-head { display: flex; gap: 4px; align-items: center; padding: 10px 10px 6px; }
.sv-head .inp { flex: 1; min-width: 0; height: 34px; font-weight: 700; }
.sv-desc { margin: 0 14px 6px; line-height: 1.4; }
.sv-body { flex: 1; overflow-y: auto; padding: 0 14px 10px; overscroll-behavior: contain; }
.sv-body .frow { grid-template-columns: minmax(0,1fr) minmax(120px, 58%); }
.sv-body .inline-row > .frow { flex: 1 1 130px; grid-template-columns: 1fr; gap: 4px; }
.sv-run { margin: 8px 12px 12px; width: auto; min-height: 42px; font-size: 15px; }
.sv-run.buy { background: var(--up); color: #fff; border-color: transparent; } .sv-run.sell { background: var(--down); color: #fff; border-color: transparent; }
.sv-sym { justify-content: flex-start; font-weight: 700; }
.rule-t { font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
.rules { display: flex; flex-direction: column; gap: 6px; }
.rule { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--raise); }
.rule .inp { height: 30px; width: auto; padding: 0 6px; font-size: 13px; }
.operand { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.operand .inp.num.sm, .rule .inp.num { width: 62px; }
.sv-main { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 12px 16px 24px; gap: 12px; }
.sv-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sv-top h2 { margin: 0; font-size: 19px; }
.sv-status { font-size: 13px; }
.sv-empty { padding: 30px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sv-empty p { margin: 0; max-width: 60ch; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kpi { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.up b { color: var(--up); } .kpi.dn b { color: var(--down); }
.sv-chart { height: 300px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.sv-tabs { padding: 0; }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 60vh; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); white-space: nowrap; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--raise); }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.mtab { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 13.5px; }
.mtab dt, .mtab dd { padding: 7px 4px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); margin: 0; }
.mtab dt { color: var(--muted); } .mtab dd { text-align: right; font-weight: 600; }
.logl { font-size: 12.5px; font-family: var(--code); max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.logl div { padding: 2px 0; }
.nrm-banner { display: flex; align-items: center; gap: 10px; padding: 7px 14px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 16%, transparent) 0 12px, color-mix(in srgb, var(--warn) 8%, transparent) 12px 24px); border-bottom: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); font-size: 13px; }
.nrm-banner b { color: var(--warn); letter-spacing: .12em; font-size: 14px; padding: 1px 8px; border: 1.5px solid var(--warn); border-radius: 6px; }
.nrm { display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.nrm-px { color: var(--accent); }
.nrm-body { display: flex; flex-direction: column; gap: 12px; }
.nrm-h { margin: 6px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.notice.warn { color: var(--warn); }
/* alertas */
.alerts { padding: 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.al-head { display: flex; align-items: center; } .al-head h3 { margin: 0; font-size: 17px; }
.al-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.al-row .grow { display: flex; flex-direction: column; min-width: 0; } .al-row b { font-size: 13.5px; } .al-row small { font-size: 12px; }
.al-row.off { opacity: .55; }
.al-form { padding: 10px; border: 1px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); display: flex; flex-direction: column; gap: 4px; }
.al-form .frow { grid-template-columns: minmax(0,1fr) minmax(110px, 60%); }
.side-tabs [role="tab"] .cnt { font-style: normal; font-size: 11px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; display: inline-grid; place-items: center; }
.rail .ib[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: 2px; right: 2px; font-size: 10px; min-width: 14px; height: 14px; border-radius: 99px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.rail .ib { position: relative; }
.cat-item { position: relative; }
.cat-item .star { position: absolute; top: 4px; right: 4px; opacity: .45; }
.cat-item:hover .star, .cat-item .star[aria-pressed="true"] { opacity: 1; }
.star[aria-pressed="true"] { color: var(--warn); } .star[aria-pressed="true"] svg { fill: currentColor; }
.pad { padding: 10px 16px 0; }

@media (prefers-reduced-motion: no-preference) {
  .row, .tf, .btn, .ib, .add, .ind-btn { transition: background-color .12s, color .12s, border-color .12s; }
}

/* ---------- celular ---------- */
@media (max-width: 860px) {
  :root { --top-h: 50px; }
  .brand, .top-icons, .tools, .rail, .feed span { display: none; }
  .main { grid-template-columns: 1fr !important; }
  .app.no-side .side { display: flex; }
  .ind-btn { padding: 0 9px; } .ind-btn span:last-child { display: none; }
  .sym-btn { padding: 0 8px; flex: none; } .sym-btn .badge { display: none; }
  .dstyle { right: auto; left: 8px; top: auto; bottom: 10px; flex-wrap: wrap; max-width: calc(100% - 80px); }
  .side { position: fixed; inset: 0; z-index: 30; border-left: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .side:not(.open) { display: none !important; }
  .side-close { display: inline-grid; }
  .row .rm { opacity: 1; }
  .row { padding-block: 9px; }
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border-top: 1px solid var(--line); position: relative; z-index: 35;
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .bnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 12px; color: var(--muted); }
  .bnav button[aria-pressed="true"] { color: var(--accent); }
  .bnav .acc { color: var(--accent); }
  .modal { place-items: end stretch; padding: 0; }
  .sheet, .sheet.wide, .sheet.small { width: 100%; max-height: 90%; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal#mConfirm, .modal#mPrompt { place-items: center; padding: 16px; }
  #mConfirm .sheet, #mPrompt .sheet { border-radius: 10px; }
  .lrow .lacts { display: none !important; }
  .lrow.show-acts .lacts { display: flex !important; }
  .phead .ohlc[data-k=h], .phead .ohlc[data-k=l] { display: none; }
  .ifield { grid-template-columns: minmax(0,1fr) minmax(110px, 46%); }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .type-btn { flex: none; }
  .side-resize { display: none; }
  .dstyle { max-width: calc(100% - 16px); }
  .dstyle .dname { display: none; }
  .set-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .set-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .set-nav button { white-space: nowrap; }
  .frow { grid-template-columns: minmax(0,1fr) minmax(110px, 50%); }
  .srow { grid-template-columns: auto minmax(0,1fr) 48px; }
  .srow .sctr { grid-column: 1 / -1; justify-content: flex-start; }
  .menu { max-height: 60vh; }
  .wi-grid { grid-template-columns: auto 1fr auto 1fr; }
  .views { display: none; }
  #vStrat, .nrm { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .view { overflow-y: auto; }
  .sv-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .sv-body { overflow: visible; }
  .sv-main { overflow: visible; padding: 12px; }
  .mgrid { grid-template-columns: 1fr; }
  .cell-bar { display: none !important; }
  .replay-bar { bottom: 12px; left: 8px; right: 8px; transform: none; flex-wrap: wrap; white-space: normal; }
  .dock { display: none; }
  .modal.float .sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-height: 62vh; border-radius: 14px 14px 0 0; }
  .ide-bar .ide-sel { max-width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu, .cpop, .fade, .modal.in .sheet.set { animation: none !important; }
}

/* ---- watchlist avanzada ---- */
.wl-tools { display: flex; gap: 4px; padding: 0 8px 6px 10px; align-items: center; }
.wl-tools .inp { flex: 1; min-width: 0; height: 30px; }
.wl .row.flagged { box-shadow: inset 3px 0 0 var(--flag); }
.wl.flat .grip { visibility: hidden; }
.fdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 2px; }
#wlSort[aria-pressed="true"] { color: var(--accent); }

/* ---- fundamentales y noticias ---- */
.fgrp { border-top: 1px solid var(--line); padding: 6px 0; }
.fgrp summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.fgrp .about { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.side-pane.news { overflow: auto; padding: 10px; }
.nlist { display: flex; flex-direction: column; gap: 2px; }
.nitem { display: flex; gap: 10px; padding: 8px; border-radius: var(--r); color: inherit; text-decoration: none; }
.nitem:hover { background: var(--raise); }
.nitem img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.nitem b { display: block; font-weight: 600; font-size: 13px; line-height: 1.35; }
.nitem small { display: block; margin-top: 3px; }

/* ---- ajustes generales ---- */
body.no-tips .tip { display: none !important; }
body.no-motion *, body.no-motion *::before, body.no-motion *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
.set-sec .frow label { display: flex; flex-direction: column; gap: 4px; width: 100%; }

/* =====================================================================
   SpaceView 2.4 — diseño: Liquid Glass moderado, Geist + Geist Mono.
   Transparencias y desenfoque SOLO en elementos flotantes (menús, ventanas, barras sobre el gráfico):
   los paneles grandes son sólidos con un brillo sutil, para no cargar la GPU.
   ===================================================================== */
:root {
  --bg: #080b12; --panel: #0e131d; --raise: #151b28; --hover: #1b2232; --line: #1f2737; --line2: rgba(255,255,255,.06);
  --fg: #e6ebf4; --muted: #8a94a9; --faint: #566075;
  --accent: #4b9dff; --accent2: #36c5f0; --accent-deep: #1f5fbf; --accent-ink: #ffffff; --accent-soft: rgba(75,157,255,.14);
  --grad: linear-gradient(135deg, #3d8bfd 0%, #22b8e6 100%);
  --glass: rgba(16,21,32,.72); --glass-b: rgba(255,255,255,.08); --glass-hi: rgba(255,255,255,.05);
  --r: 8px; --r2: 12px; --gap: 6px;
  --shadow: 0 18px 50px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3);
}
:root[data-theme="light"] {
  --bg: #eef1f6; --panel: #ffffff; --raise: #f2f4f9; --hover: #e8ecf4; --line: #dde2ec; --line2: rgba(0,0,0,.05);
  --fg: #121826; --muted: #5a6479; --faint: #98a1b3;
  --accent: #1f6fe0; --accent2: #0aa3d0; --accent-deep: #1653ad; --accent-soft: rgba(31,111,224,.10);
  --grad: linear-gradient(135deg, #1f6fe0 0%, #0aa3d0 100%);
  --glass: rgba(255,255,255,.78); --glass-b: rgba(10,20,40,.08); --glass-hi: rgba(255,255,255,.6);
  --shadow: 0 18px 50px rgba(20,30,60,.16), 0 2px 8px rgba(20,30,60,.08);
}
body { font: 450 14px/1.4 var(--font); letter-spacing: -.005em; background: var(--bg); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- estructura: paneles separados con esquinas redondeadas ---------- */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.main { gap: var(--gap); padding: var(--gap); background: var(--bg); }
.tools, .chart-area, .side, .rail { border-radius: var(--r2); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--glass-hi); overflow: hidden; }
.tools, .rail { background: var(--panel); }
.side { border-left: 1px solid var(--line); }
.chart-area { background: var(--panel); }
@media (max-width: 860px) { .main { gap: 0; padding: 0; } .tools, .chart-area, .side, .rail { border-radius: 0; border: 0; box-shadow: none; } }

/* ---------- barra superior ---------- */
.brand { font-weight: 650; letter-spacing: -.01em; }
.sym-btn { height: 32px; border-radius: 9px; background: var(--raise); border: 1px solid var(--line2); }
.sym-btn b { font-weight: 650; letter-spacing: 0; }
.sym-gear { margin-left: -2px; }
.tf { font-family: var(--mono); font-size: 13px; height: 30px; padding: 0 8px; border-radius: 8px; letter-spacing: -.02em; }
.tf[aria-pressed="true"] { color: var(--fg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.tf-dd { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; }
.tf-dd svg { opacity: .7; }
.tf-dd.cur { color: var(--fg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.ind-btn { border-radius: 9px; font-weight: 600; }
.badge { font-weight: 550; }
.badge.m-crypto { color: #f5b74e; } .badge.m-byma { color: #6cb4ff; } .badge.m-us { color: #7fd0c0; }

/* ---------- menús, ventanas y avisos: vidrio ---------- */
.menu, .sheet, .toast, .tool-chip, .dstyle, .replay-bar, .delta-card, .tip {
  background: var(--glass) !important; -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-b) !important; box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
.menu { border-radius: 12px; padding: 5px; }
.menu-i { border-radius: 8px; }
.menu .mstar { margin-left: auto; padding: 0 4px; color: var(--faint); font-size: 15px; line-height: 1; }
.menu .mstar.on { color: #f5b74e; }
.menu .mstar:hover { color: var(--fg); }
.sheet { border-radius: 16px; }
.no-motion .menu, .no-motion .sheet, .no-motion .toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel) !important; }

/* ---------- leyendas del gráfico ---------- */
.legends .lname { font-weight: 550; }
.legends .lvals { font-family: var(--mono); letter-spacing: -.02em; }
.legends .phead .ohlc span, .legends .phead .ohlc { font-family: var(--mono); letter-spacing: -.02em; }
.legends .lsym { font-family: var(--font); font-weight: 650; }
.sbtn.pane-a { position: absolute; left: 0; top: 0; z-index: 6; width: 22px; height: 18px; font-size: 11px; border-radius: 5px; opacity: .55; }
.sbtn.pane-a:hover, .sbtn.pane-a:not(.on) { opacity: 1; }
.sbtn.pane-a:not(.on) { color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 50%, transparent); }

/* ---------- panel lateral: lista ---------- */
.side-head { padding: 8px 6px 4px 10px; gap: 2px; }
.list-sel { font-weight: 650; border: 0; background: transparent; padding: 4px 2px; border-radius: 8px; max-width: 70%; }
.list-sel:hover { background: var(--raise); }
.wl-tools { padding: 2px 8px 8px 10px; gap: 6px; }
.wl-views { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--raise); border: 1px solid var(--line2); flex: none; }
.wl-views .wv { height: 24px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 550; color: var(--muted); }
.wl-views .wv:hover { color: var(--fg); }
.wl-views .wv[aria-pressed="true"] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--line2); }
.wl-views .wv[data-v="gainers"][aria-pressed="true"] { color: var(--up); }
.wl-views .wv[data-v="losers"][aria-pressed="true"] { color: var(--down); }
.wl-tools .inp { height: 28px; border-radius: 8px; }
.wl { padding: 0 6px 6px; }
.wl .row, .row { grid-template-columns: 22px minmax(0,1fr) auto 64px; gap: 8px; padding: 5px 8px; margin: 1px 0; border: 0; border-radius: 9px; background: transparent; min-height: 38px; }
.row:hover { background: var(--raise); }
.row[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.wl .row.flagged { box-shadow: inset 3px 0 0 var(--flag); }
.row[aria-current="true"].flagged { box-shadow: inset 3px 0 0 var(--flag), inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.row .s b { font-size: 13.5px; font-weight: 600; letter-spacing: 0; }
.row .s small { font-size: 11px; line-height: 1.1; }
.row .p { font-size: 13px; }
.chg { font-size: 12px; padding: 2px 6px; border-radius: 6px; text-align: right; }
.row.dragging { background: var(--hover); border-radius: 9px; }
.row.sec { grid-template-columns: 14px minmax(0,1fr) auto; min-height: 28px; padding: 6px 8px 4px; margin-top: 6px; background: transparent; }
.row.sec .s b { font-size: 11px; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.row.sec:hover .s b { color: var(--fg); }
.logo { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--raise); flex: none; box-shadow: inset 0 0 0 1px var(--line2); }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo.ini { background: hsl(var(--h) 45% 32%); color: hsl(var(--h) 80% 88%); font-weight: 700; letter-spacing: -.02em; font-family: var(--font); }
:root[data-theme="light"] .logo.ini { background: hsl(var(--h) 60% 88%); color: hsl(var(--h) 55% 30%); }
body.side-hiding .side { opacity: .45; }

/* ---------- resumen del activo (debajo de la lista) ---------- */
.wl-split { height: 7px; flex: none; cursor: row-resize; position: relative; touch-action: none; }
.wl-split::after { content: ""; position: absolute; left: 50%; top: 2px; width: 36px; height: 3px; margin-left: -18px; border-radius: 3px; background: var(--line); }
.wl-split:hover::after { background: var(--accent); }
.wl-sum { flex: none; height: var(--sum-h, 46%); min-height: 120px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); padding: 10px 12px 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--raise) 55%, transparent), transparent 120px); }
.wl-sum.closed { height: auto; min-height: 0; }
.ws-head { display: flex; align-items: center; gap: 10px; }
.ws-nm { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ws-nm b { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-nm small { color: var(--muted); font-size: 11.5px; }
.ws-tg svg { transition: transform .15s; }
.wl-sum.closed .ws-tg svg { transform: rotate(180deg); }
.ws-top { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; margin-top: 8px; }
.wl-sum.closed .ws-top { grid-template-columns: 1fr; } .wl-sum.closed .ws-ring, .wl-sum.closed .ws-kv, .wl-sum.closed .ws-leg { display: none; }
.ws-ring svg { display: block; }
.ws-ring .r-k { font: 600 8px var(--mono); fill: var(--muted); letter-spacing: .1em; }
.ws-ring .r-v { font: 650 13px var(--mono); }
.ws-ring .r-s { font: 500 7.5px var(--mono); fill: var(--faint); }
.ws-last { font-size: 24px; font-weight: 650; line-height: 1.1; }
.ws-chg { font-size: 12.5px; margin: 2px 0 6px; color: var(--muted); }
.ws-chg.up { color: var(--up); } .ws-chg.dn { color: var(--down); }
.ws-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12.5px; }
.ws-kv dt { color: var(--muted); font-family: var(--font); letter-spacing: 0; }
.ws-kv dd { margin: 0; text-align: right; }
.ws-leg { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.ws-leg div { display: flex; align-items: center; gap: 7px; }
.ws-leg .dot { width: 14px; height: 3px; border-radius: 2px; background: var(--faint); flex: none; }
.ws-leg .dot.acc { background: var(--accent); } .ws-leg .dot.up { background: var(--up); }
.ws-sec { margin-top: 14px; }
.ws-sec-t { display: flex; justify-content: space-between; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line2); margin-bottom: 8px; }
.ws-verdict { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ws-verdict b { font-size: 14px; } .ws-verdict span { font: 11px var(--mono); }
.ws-verdict.up b { color: var(--up); } .ws-verdict.dn b { color: var(--down); } .ws-verdict.soft b { opacity: .85; }
.ws-tr { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.ws-tr li { display: grid; grid-template-columns: 92px 1fr; gap: 6px; }
.ws-tr .k { color: var(--muted); }
.ws-tr .up { color: var(--up); } .ws-tr .dn { color: var(--down); } .ws-tr .warn { color: var(--warn); }
.ws-news { display: flex; flex-direction: column; gap: 10px; }
.ws-n { display: grid; grid-template-columns: 56px 1fr; gap: 10px; color: inherit; text-decoration: none; border-radius: 8px; }
.ws-n:hover p { color: var(--accent); }
.ws-n img, .ws-nph { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--raise); }
.ws-nm2 { display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; flex-wrap: wrap; }
.ws-nm2 .num { margin-left: auto; font-size: 11px; }
.ws-nm2 .up { color: var(--up); } .ws-nm2 .dn { color: var(--down); }
.ws-n p { margin: 2px 0 0; font-size: 13px; font-weight: 550; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.up { color: var(--up); } .dn { color: var(--down); }
.pleg { width: max-content; }
.lrow { min-height: 21px; padding: 0 6px; }
.lrow .lvals { overflow: visible; }
.lrow .lacts .ib.sm { width: 20px; height: 20px; }
.phead { margin-bottom: 3px; }
/* filtro de la lista: ícono que se abre en un campo */
.wl-tools .wl-find { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.wl-tools .wl-find .inp { width: 100%; max-width: 0; padding: 0; border-color: transparent; opacity: 0; transition: max-width .18s, opacity .18s; }
.wl-tools .wl-find.open .inp { max-width: 100%; padding: 0 8px; opacity: 1; border-color: var(--line); }
.wl-tools .wl-find.open + .ib, .wl-tools .wl-find.open ~ #wlSort { display: none; }
.side-resize { left: 0; width: 7px; }
.side-resize::after { left: 0; }

/* ---------- grilla principal con panel de órdenes ---------- */
:root { --op-w: 284px; }
.main { gap: 0; grid-template-columns: 44px minmax(0,1fr) 0 var(--side-w) 44px; }
.app.with-op .main { grid-template-columns: 44px minmax(0,1fr) var(--op-w) var(--side-w) 44px; }
.app.no-side .main { grid-template-columns: 44px minmax(0,1fr) 0 0 44px; }
.app.with-op.no-side .main { grid-template-columns: 44px minmax(0,1fr) var(--op-w) 0 44px; }
.tools { grid-column: 1; } .chart-area { grid-column: 2; margin-left: var(--gap); } .op { grid-column: 3; margin-left: var(--gap); } .side { grid-column: 4; margin-left: var(--gap); } .rail { grid-column: 5; margin-left: var(--gap); }
.rail .rail-op { margin-top: 8px; position: relative; }
.rail .rail-op::before { content: ""; position: absolute; top: -5px; left: 8px; right: 8px; height: 1px; background: var(--line); }

/* ---------- panel de órdenes ---------- */
.op { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: inset 0 1px 0 var(--glass-hi); overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.op-head { display: flex; align-items: center; gap: 6px; }
.op-t { display: flex; align-items: center; gap: 7px; } .op-t b { font-size: 15px; font-weight: 650; }
.op-nrm { font: 700 10px var(--mono); letter-spacing: .12em; padding: 2px 6px; border-radius: 5px; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.op-msg { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.op-acct { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line2); }
.op-acct select { width: 100%; }
.op-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12.5px; }
.op-kv dt { color: var(--muted); font-family: var(--font); letter-spacing: 0; } .op-kv dd { margin: 0; text-align: right; }
.op-px { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.op-sym { font-weight: 650; } .op-last { font-size: 20px; font-weight: 650; } .op-px small { width: 100%; font-size: 11px; }
.op-bs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.op-bs button { height: 40px; border-radius: 10px; font-weight: 650; font-size: 14px; border: 1px solid var(--line); background: var(--raise); color: var(--muted); }
.op-bs .op-buy[aria-pressed="true"] { background: var(--up); border-color: transparent; color: #fff; }
.op-bs .op-sell[aria-pressed="true"] { background: var(--down); border-color: transparent; color: #fff; }
.op-type { width: 100%; } .op-type button { flex: 1; }
.op-form { display: flex; flex-direction: column; gap: 8px; }
.op-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.op-f .inp { height: 34px; font-size: 14px; color: var(--fg); }
.op-pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.op-pcts button { height: 26px; border-radius: 7px; font: 500 12px var(--mono); background: var(--raise); border: 1px solid var(--line2); color: var(--muted); }
.op-pcts button:hover { color: var(--fg); border-color: var(--line); }
.op-risk { display: flex; flex-direction: column; gap: 6px; }
.op-tg { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.op-tg .inp { width: 110px; height: 30px; }
.op-sum { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; padding: 8px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.op-sum dt { color: var(--muted); font-family: var(--font); letter-spacing: 0; } .op-sum dd { margin: 0; text-align: right; }
.op-go { width: 100%; min-height: 42px; border-radius: 10px; color: #fff; border: 0; font-weight: 650; }
.op-go.buy { background: var(--up); } .op-go.sell { background: var(--down); }
.op-go:disabled { opacity: .45; cursor: not-allowed; }
.op-note { font-size: 11px; line-height: 1.35; }
.op-sec { display: flex; flex-direction: column; gap: 6px; }
.op-sec-t { display: flex; justify-content: space-between; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: 5px; border-bottom: 1px solid var(--line2); }
.op-pos { padding: 8px; border-radius: 10px; background: var(--raise); border-left: 3px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.op-pos.short { border-left-color: var(--down); } .op-pos.long { border-left-color: var(--up); }
.op-acts { display: flex; gap: 6px; } .op-acts .btn { min-height: 28px; font-size: 12.5px; }
.op-ord, .op-fill { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.op-ord .num, .op-fill .num { margin-left: auto; }
.op-fill small { width: 100%; font-size: 11px; }
@media (max-width: 860px) {
  .main, .app.with-op .main, .app.no-side .main { grid-template-columns: 1fr; }
  .chart-area, .op, .side, .rail, .tools { margin-left: 0; grid-column: 1; }
  .op { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); max-height: 72vh; z-index: 31; border-radius: 16px 16px 0 0; box-shadow: var(--shadow); }
}
/* cursor del gráfico: cruz (como en las plataformas profesionales); sobre un dibujo, mano */
.chart-host, .chart-host[data-tool="cursor"] { cursor: crosshair; }
.chart-host.over-drawing { cursor: pointer; } .chart-host.over-handle { cursor: grab; }
.op > * { flex: none; }
/* ---------- catálogo de indicadores: cuadrícula / lista ---------- */
.ind-q { display: flex; gap: 6px; align-items: center; padding: 0 16px; }
.ind-q .search { flex: 1; }
.cat { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cat-item { border-radius: 10px; gap: 3px; }
.cat-item .ind-pv { display: block; height: 46px; margin: -2px -4px 4px; border-radius: 7px; background: color-mix(in srgb, var(--bg) 60%, transparent); overflow: hidden; }
.cat-item .ind-pv svg { display: block; }
.cat-item .ind-pv .pv-t { font: 10px var(--mono); fill: var(--faint); }
.cat-item small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ind-list .cat { grid-template-columns: 1fr; gap: 0; }
.ind-list .cat-item { flex-direction: row; align-items: center; padding: 7px 34px 7px 12px; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; background: transparent; }
.ind-list .cat-item:hover { background: var(--raise); }
.ind-list .cat-item small, .ind-list .cat-item .ind-pv { display: none; }
.ind-list .cat-item .star { top: 50%; transform: translateY(-50%); }
.vis-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.vis-g { width: 72px; color: var(--muted); font-size: 12.5px; }
.vis-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; background: var(--raise); border: 1px solid var(--line2); font: 12px var(--mono); cursor: pointer; }
.vis-chip input { margin: 0; }
/* ---------- Noticias ---------- */
#vNews { overflow-y: auto; padding: 16px clamp(12px, 3vw, 32px) 40px; }
.nw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 980px; margin: 0 auto; }
.nw-head h2 { margin: 0 8px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.nw-q { flex: 1 1 200px; height: 34px; }
.nw-mine { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.nw-cats { display: flex; gap: 6px; flex-wrap: wrap; max-width: 980px; margin: 12px auto 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--raise); font-size: 12.5px; color: var(--muted); }
.chip:hover { color: var(--fg); }
.chip[aria-pressed="true"] { color: var(--fg); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip.sm { height: 24px; padding: 0 8px 0 4px; font: 500 12px var(--mono); }
.nw-status { max-width: 980px; margin: 0 auto 8px; }
.nw-list { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; }
.nw-item { padding: 12px 4px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 4px; }
.nw-meta { display: flex; gap: 10px; font-size: 12px; align-items: baseline; }
.nw-meta b { color: var(--accent); font-weight: 600; }
.nw-t { color: var(--fg); text-decoration: none; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.nw-t:hover { color: var(--accent); }
.nw-s { margin: 0; font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-rel { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
/* módulo «Últimas actualizaciones» sobre el gráfico */
.chart-area { position: relative; }
.chart-news { position: absolute; left: 12px; bottom: 40px; z-index: 8; width: min(340px, calc(100% - 120px)); border-radius: 12px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--glass-b); box-shadow: var(--shadow); overflow: hidden; }
.cn-head { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 34px 7px 10px; font-size: 12.5px; }
.cn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cn-n { font-size: 11px; color: var(--muted); }
.cn-chev { margin-left: auto; display: flex; color: var(--muted); transition: transform .15s; transform: rotate(180deg); }
.chart-news.open .cn-chev { transform: none; }
.cn-x { position: absolute; top: 5px; right: 6px; }
.cn-list { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line2); }
.cn-i { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; text-decoration: none; color: var(--fg); font-size: 12.5px; line-height: 1.3; border-bottom: 1px solid var(--line2); }
.cn-i:hover { background: var(--accent-soft); }
.cn-i small { font-size: 11px; }
@media (max-width: 860px) { .chart-news { display: none; } }
.liq { margin-top: 8px; } .liq-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.liq-i { display: flex; gap: 8px; align-items: baseline; font-size: 12px; } .liq-i .num { margin-left: auto; }
.kv dd.up { color: var(--up); } .kv dd.dn { color: var(--down); }
@media (max-width: 860px) { #opTop, #chartGear, #replayBtn { display: none; } .tfs { flex: 1 1 auto; } }
/* ---------- cuenta ---------- */
.acc-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; margin-left: 4px; }
.acc-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--muted); font: 650 12px var(--font); }
.acc-btn.in .acc-av { background: var(--grad); color: #fff; border-color: transparent; }
.acc-btn.err .acc-av { box-shadow: 0 0 0 2px var(--warn); }
.auth .sheet-pad { display: flex; flex-direction: column; gap: 10px; }
.auth-f .op-f .inp { height: 38px; }
/* ---------- comunidad ---------- */
#vCommunity { overflow-y: auto; padding: 16px clamp(12px, 3vw, 32px) 40px; }
.cm-head, .cm-body { max-width: 900px; margin: 0 auto; }
.cm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cm-head h2 { margin: 0; font-size: 22px; font-weight: 650; }
.cm-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.cm-bar .inp { flex: 1 1 220px; height: 34px; }
.cm-list { display: flex; flex-direction: column; gap: 8px; }
.cm-card { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.cm-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cm-card h3 { margin: 6px 0 4px; font-size: 15.5px; font-weight: 650; }
.cm-card p { margin: 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.cm-meta .link { padding: 0; }
.cm-kind { font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.cm-stats { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); } .cm-stats .on { color: var(--accent); }
.cm-post h2 { margin: 8px 0; font-size: 21px; }
.cm-text p { margin: 0 0 8px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-code { max-height: 420px; overflow: auto; padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font: 12.5px/1.5 var(--code); white-space: pre; }
.cm-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.cm-comments { border-top: 1px solid var(--line2); padding-top: 10px; }
.cm-c { padding: 8px 0; border-bottom: 1px solid var(--line2); } .cm-c p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.cm-cf { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; margin-top: 10px; } .cm-cf textarea { width: 100%; }
.cm-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.cm-form textarea { min-height: 140px; }
.cm-off { padding: 24px; border-radius: 12px; border: 1px dashed var(--line); text-align: center; }
.lv-panel { position: fixed; z-index: 60; width: 350px; max-height: 70vh; overflow: auto; padding: 10px; border-radius: 12px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-b); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.lv-head { display: flex; justify-content: space-between; align-items: center; }
.lv-list { display: flex; flex-direction: column; gap: 4px; }
.lv-row { display: grid; grid-template-columns: 18px 72px 30px 64px 64px 24px; gap: 6px; align-items: center; }
.lv-row .inp { height: 28px; padding: 0 6px; }
.lv-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
