/* SpaceView 0.6 — estilos nuevos (Sol 2, Mercados+Sol, integrados, brokers, scrollbars de vidrio líquido…) */

/* ---------- Sol ---------- */
.sol-panel { width: min(460px, calc(100vw - 24px)); }
.sol-body { scroll-behavior: smooth; } .sol-body > * { flex-shrink: 0; }
.sol-in { animation: solIn .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); }
@keyframes solIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.no-motion .sol-in { animation: none; }
.sol-load { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sol-sun { color: #f7c948; display: inline-flex; animation: solSpin 6s linear infinite; filter: drop-shadow(0 0 10px rgba(247,201,72,.6)); }
@keyframes solSpin { to { transform: rotate(360deg); } } body.no-motion .sol-sun { animation: none; }
.sol-hero { position: relative; padding: 12px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(120,130,170,.16), transparent 70%), color-mix(in srgb, var(--panel) 70%, transparent); }
.sol-hero.up { background: radial-gradient(120% 90% at 50% 0%, rgba(34,199,160,.26), transparent 70%), color-mix(in srgb, var(--panel) 70%, transparent); border-color: rgba(34,199,160,.4); }
.sol-hero.down { background: radial-gradient(120% 90% at 50% 0%, rgba(255,90,104,.26), transparent 70%), color-mix(in srgb, var(--panel) 70%, transparent); border-color: rgba(255,90,104,.4); }
.sol-hero .sol-top { align-self: stretch; }
.sol-gauge { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sol-gauge-svg { width: 100%; height: auto; display: block; }
.sol-needle { transition: transform 1s cubic-bezier(.2, .9, .25, 1.15); }
body.no-motion .sol-needle { transition: none; }
.sol-gauge.big { width: 220px; max-width: 100%; }
.sol-gv { font-family: var(--mono); font-size: 14px; line-height: 1; margin-top: -4px; }
.sol-gauge.big .sol-gv { font-size: 26px; margin-top: 4px; }
.sol-gv.up { color: #22c7a0; } .sol-gv.dn { color: #ff5a68; }
.sol-gl { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 3px; }
.sol-gs { font-size: 10.5px; color: var(--muted); opacity: .85; }
.sol-gauge.big .sol-gl { font-size: 11px; } .sol-gauge.big .sol-gs { font-size: 12px; color: var(--text); }
.sol-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raise) 55%, transparent); }
.sol-gauges .sol-gauge { padding-top: 2px; }
.sol-gauge.sqz { justify-content: center; gap: 4px; }
.sol-sqz { font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; margin-top: 12px; }
.sol-sqz.on { background: rgba(247,201,72,.2); color: #f7c948; box-shadow: 0 0 12px rgba(247,201,72,.35); animation: solBlink 1.4s ease-in-out infinite; }
.sol-sqz.rel { background: rgba(34,199,160,.2); color: #22c7a0; } .sol-sqz.off { background: rgba(135,145,168,.18); color: var(--muted); }
@keyframes solBlink { 50% { opacity: .55; } } body.no-motion .sol-sqz.on { animation: none; }
.sol-mini { width: 100%; height: auto; border-radius: 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); }
.sol-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; font-size: 10.5px; color: var(--muted); } .sol-legend i { font-style: normal; font-weight: 800; margin-right: 4px; }
/* texto con énfasis: subrayado de color */
.sol-hl { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.sol-hl.up { color: #3be0b6; text-decoration-color: #22c7a0; } .sol-hl.dn { color: #ff7b87; text-decoration-color: #ff5a68; }
.sol-hl.am { color: #f7c948; text-decoration-color: #c99a1f; } .sol-hl.n { font-family: var(--mono); font-weight: 600; text-decoration: none; color: var(--text); }
.sol-ul li { padding: 3px 0 3px 10px; transition: background .2s; } .sol-ul li:hover { background: rgba(255,255,255,.04); }
.sol-grp { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: color-mix(in srgb, var(--raise) 40%, transparent); }
.sol-grp summary { cursor: pointer; padding: 7px 10px; display: flex; align-items: center; gap: 6px; list-style: none; font-size: 12.5px; } .sol-grp summary::-webkit-details-marker { display: none; }
.sol-grp[open] summary { border-bottom: 1px solid var(--line); } .sol-grp > ul { padding: 6px 10px 8px; }
.sol-gi { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 6px; background: rgba(247,201,72,.14); color: #f7c948; font-size: 12px; }
.sol-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sol-notes { display: flex; flex-direction: column; gap: 4px; } .sol-notes textarea { resize: vertical; min-height: 64px; font-size: 12.5px; }
.sol-sc b { font-size: 13px; }
/* lectura de mercado */
.sol-mk-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); } .sol-mk-bar i { display: block; transition: width .8s cubic-bezier(.2,.9,.3,1); }
.sol-mk-bar .u { background: linear-gradient(90deg, #12806a, #22c7a0); } .sol-mk-bar .d { background: linear-gradient(90deg, #ff5a68, #b6121f); margin-left: auto; }
.sol-mk-lbl { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 4px; font-family: var(--mono); }
.sol-mk-list { display: flex; flex-direction: column; gap: 3px; } .sol-mk-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: color-mix(in srgb, var(--raise) 50%, transparent); border: 1px solid transparent; cursor: pointer; font-size: 12.5px; text-align: left; color: inherit; font-family: inherit; }
.sol-mk-row:hover { border-color: var(--line); background: var(--raise); } .sol-mk-row .num.up { color: #22c7a0; } .sol-mk-row .num.dn { color: #ff5a68; }
.sol-mk-sec { display: grid; grid-template-columns: 96px 1fr 52px; align-items: center; gap: 6px; font-size: 12px; } .sol-mk-sec .tr { height: 8px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; } .sol-mk-sec .tr i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.xp-sol { display: inline-flex; align-items: center; gap: 6px; } .xp-sol { color: #f7c948; }
@media (max-width: 640px) { .sol-gauges { grid-template-columns: repeat(2, 1fr); } .sol-panel { width: auto; } }

/* ---------- panel de indicadores: sección «Integrados de la plataforma» ---------- */
.indp-ni[data-nav="platform"] span { white-space: normal; line-height: 1.15; }
.indp-ni[data-nav="platform"] svg { color: #f7c948; }

/* ---------- Billetera NRM / brokers vinculados: deja libre el eje de tiempo (0.6) ---------- */
.chart-area > .nrmw { bottom: 40px; max-height: calc(100% - 52px); }
@media (max-width: 640px) { .chart-area > .nrmw { bottom: 34px; left: 6px; right: 6px; } }

/* ---------- Brokers (0.6): bóveda, vincular, cuenta, orden real ---------- */
.bk-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.bk-head { display: flex; align-items: center; gap: 10px; } .bk-head svg { border-radius: 9px; }
.bk-head > div { display: flex; flex-direction: column; }
.bk-form { display: flex; flex-direction: column; gap: 9px; }
.bk-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; } .bk-f > span { color: var(--muted); font-weight: 600; }
.bk-chk { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; cursor: pointer; } .bk-chk input { margin-top: 2px; accent-color: var(--accent); }
.bk-warn { border: 1px solid color-mix(in srgb, #f7c948 45%, var(--line)); background: color-mix(in srgb, #f7c948 9%, transparent); color: var(--fg); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.4; }
.bk-err { color: #ff6b78; font-size: 12.5px; margin: 0; }
.bk-steps { margin: 0; padding-left: 18px; } .bk-steps li { margin: 2px 0; }
.bk-h { font: 700 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 8px 0 2px; }
.bk-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.bk-panel { display: flex; flex-direction: column; gap: 8px; } .bk-panel .brk-grid { grid-template-columns: 1fr; }
.bk-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.bk-tabs > button:not(.ib):not(.btn) { background: none; border: 0; color: var(--muted); font: 600 12.5px var(--font); padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.bk-tabs > button.on { background: var(--accent-soft); color: var(--fg); }
.bk-out { min-height: 120px; overflow: auto; } .bk-raw pre { max-height: 240px; overflow: auto; font: 11px var(--mono); white-space: pre-wrap; }
.bk-sum { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); font-size: 13px; }
.bk-sum.buy { border-color: color-mix(in srgb, var(--up) 55%, var(--line)); } .bk-sum.sell { border-color: color-mix(in srgb, #ff5a68 55%, var(--line)); }
.btn.bk-buy { background: #12806a; border-color: #12806a; color: #fff; } .btn.bk-sell { background: #c0303d; border-color: #c0303d; color: #fff; }
.btn.bk-buy:disabled, .btn.bk-sell:disabled { opacity: .45; }
.op-venue { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; font-size: 12px; color: var(--muted); } .op-venue select { max-width: 62%; }
.op-nrm.real { background: #c0303d; color: #fff; }
.op-real { display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; padding: 7px 9px; border-radius: 9px; font-size: 12px; line-height: 1.35; border: 1px solid #c0303d; background: color-mix(in srgb, #c0303d 12%, transparent); } .op-real svg { border-radius: 5px; flex: none; }
.qt-venue.real { border-color: #c0303d; box-shadow: 0 0 0 1px color-mix(in srgb, #c0303d 55%, transparent) inset; }
.bk-tut { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.bk-tut a { align-self: flex-start; }
.wl-eod { display: flex; align-items: center; gap: 8px; margin: 0 8px 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.wl-eod[hidden] { display: none; }
.ff-tools .ib.dragging { position: relative; z-index: 5; transition: none !important; box-shadow: 0 6px 18px rgba(0,0,0,.35); background: var(--accent-soft); cursor: grabbing; }
.ff-tools .ib { touch-action: none; }

/* ---------- vidrio líquido: barras de scroll + pasos numéricos ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 38%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: 10px; border: 3px solid transparent; background-clip: padding-box;
  background-color: color-mix(in srgb, var(--accent) 34%, transparent); transition: background-color .2s; }
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 62%, transparent); }
*::-webkit-scrollbar-corner { background: transparent; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stp { position: relative; display: inline-flex; align-items: stretch; vertical-align: middle; min-width: 0; }
.stp.full { display: flex; width: 100%; }
.stp > input { flex: 1 1 auto; min-width: 0; padding-right: 22px; }
.stp-b { position: absolute; right: 2px; width: 18px; height: calc(50% - 2px); padding: 0; border: 0; border-radius: 6px; cursor: pointer; line-height: 1; font-size: 9px;
  color: var(--muted); background: color-mix(in srgb, var(--accent) 10%, transparent); backdrop-filter: blur(6px); transition: background .15s, color .15s, transform .1s; }
.stp-b:first-of-type { top: 2px; } .stp-b:last-of-type { bottom: 2px; }
.stp-b:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 30%, transparent); }
.stp-b:active { transform: scale(.9); }
body.no-motion .stp-b, body.no-motion *::-webkit-scrollbar-thumb { transition: none; }

/* Billetera NRM / brokers: el gráfico cede el espacio (el eje de tiempo queda ARRIBA de la billetera, nunca tapado) */
.chart-area.has-nrmw > .charts { margin-bottom: var(--nrmw-reserve, 0px); }
.chart-area.has-nrmw > .nrmw { bottom: 8px; max-height: 70%; }
@media (max-width: 640px) { .chart-area.has-nrmw > .nrmw { bottom: 6px; max-height: 55%; } }

/* Barra de favoritas: sin recortes al escalar el botón arrastrado, desliz horizontal nativo, sin selección de texto */
.fav-float .ff-tools { padding: 5px 2px; margin: -5px -2px; touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; user-select: none; -webkit-user-select: none; scroll-behavior: auto; }
.fav-float .ff-tools .ib { flex: none; position: relative; will-change: transform; }
.fav-float .ff-tools.sorting { overflow: visible; }
.fav-float .ff-tools .dragging { opacity: .95; z-index: 3; box-shadow: 0 6px 18px rgba(0,0,0,.35); background: var(--accent-soft); }
.fav-float .ff-grip, .fav-float .ff-grip * { touch-action: none; cursor: grab; }

/* Brokers: explicación de vinculación */
.brk-how { margin: 8px 0 12px; padding: 8px 12px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 10px; background: rgba(255,255,255,.03); }
.brk-how summary { cursor: pointer; font-weight: 600; }
.brk-how p { margin: 8px 0 0; line-height: 1.45; color: var(--tx2, #aab); }
.brk-how p b { color: var(--tx, #eef); }

/* NRM: cuentas reales de brokers vinculados */
.pf2-pf.real { border-color: color-mix(in srgb, #f0b429 45%, var(--line)); background: color-mix(in srgb, #f0b429 7%, var(--raise)); }
.pf2-pf.real small { color: #f0b429; }
.pf2-pf.add.real { border-style: dashed; }
.pf2-nrm.real { color: #f0b429; border-color: color-mix(in srgb, #f0b429 50%, var(--line)); background: color-mix(in srgb, #f0b429 10%, transparent); }
.pf2-realbar { display: grid; gap: 4px; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, #f0b429 35%, var(--line)); background: color-mix(in srgb, #f0b429 6%, transparent); }
.pf2-rb-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf2-rb-t small { flex: 1; min-width: 140px; }
.pf2-brow.clk { width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 10px; }
.pf2-brow.clk:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pf2-pf.add > span { grid-area: auto; font-size: 13px; font-weight: 600; }
.pf2-pf.add svg { flex: none; }
.pf2-pf.add { width: auto; min-width: max-content; height: auto; }

/* BetelCode: visible en el editor y en el Centro de código */
.betel-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #fff; border: 0; background: linear-gradient(135deg, #7c5cff, #4aa3ff); box-shadow: 0 2px 10px rgba(110, 100, 255, .35); }
.betel-btn:hover { filter: brightness(1.1); }
.betel-btn svg { flex: none; }
.betel-tile { border-color: color-mix(in srgb, #7c5cff 55%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, #7c5cff 14%, var(--raise)), color-mix(in srgb, #4aa3ff 10%, var(--raise))); }
.betel-tile .ch-tic { color: #9b86ff; }

/* Calidad de texto en pantallas HiDPI y celulares */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
canvas { image-rendering: auto; }
.bk-guide { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 10px; background: rgba(255,255,255,.03); }
.bk-guide p { margin: 0 0 6px; } .bk-guide ol { padding-left: 20px; margin: 4px 0 0; } .bk-guide li { margin: 4px 0; line-height: 1.45; }
.brk-gloss { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line, rgba(255,255,255,.1)); } .brk-gloss p { margin: 4px 0; }
