/* Same palette and density as the desktop panel (app/web/index.html). */
:root { color-scheme: dark; --fondo: #0f141b; --panel: #131a23; --borde: #1f2833; --texto: #e6edf3; --tenue: #8b98a8; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 13px system-ui, sans-serif; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 16px; border-bottom: 1px solid var(--borde); }
header h1 { margin: 0; font-size: 17px; letter-spacing: 1.5px; white-space: nowrap; }
#identity { color: var(--tenue); font-size: 12px; }
#price { font-size: 15px; font-weight: 800; white-space: nowrap; }
#source { color: #f5c542; font-size: 12px; overflow-wrap: anywhere; }
#hiro-summary { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
#hiro-summary span { border: 1px solid currentColor; padding: 1px 7px; white-space: nowrap; }
#hiro-total { color: #ef5555; }
#hiro-total.positivo { color: #34c759; }
#hiro-total.neutro { color: var(--tenue); }
#hiro-calls { color: #34c759; }
#hiro-puts { color: #f62867; }
#hiro-calls:empty, #hiro-puts:empty { display: none; }
/* VIX proximity pills (owner, b37; b43 margins in panel_spx_grafico.js): one per level; b44: blink on a 3 s cycle. */
#vix-alertas { display: inline-flex; flex-wrap: wrap; gap: 6px; }
#vix-alertas:empty { display: none; }
.alerta-vix { padding: 1px 8px; border-radius: 4px; color: #0f141b; font-size: 13px; font-weight: 700; white-space: nowrap;
  animation: parpadeo-vix 3s steps(1, end) infinite; }
@keyframes parpadeo-vix { 50% { opacity: 0; } }
/* DELTA and GAMMA pills, desktop colours (index.html #delta-trace and #regimen). */
#delta-pressure, #gamma-pressure { font-size: 15px; font-weight: 700; padding: 1px 8px; border-radius: 4px; white-space: nowrap;
  background: #26364a; color: var(--texto); }
#delta-pressure.positivo, #gamma-pressure.positivo { background: #3d7fd6; color: #0f141b; }
#delta-pressure.negativo, #gamma-pressure.negativo { background: #8a2b2e; color: #000; }
.botones { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.botones .rotulo { color: var(--tenue); font-size: 12px; margin-right: 2px; }
button { font: inherit; font-size: 11px; padding: 2px 8px; background: var(--panel); color: var(--tenue);
  border: 1px solid var(--borde); border-radius: 4px; cursor: pointer; }
button[aria-pressed="true"] { background: #26364a; color: var(--texto); border-color: #6fa8ff; font-weight: 700; }
/* b45 (owner): mutes the VIX pill beep only; the page keeps no choice, so a reload starts unchecked. */
.silenciar-vix { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--tenue); white-space: nowrap; cursor: pointer; }
.silenciar-vix input { margin: 0; cursor: pointer; }
/* b46: shown while the browser still blocks the sound (first click or key, or Firefox autoplay permission). */
.aviso-sonido { font-size: 11px; color: #f2b632; white-space: nowrap; cursor: help; }
button:disabled { cursor: wait; }
#map-capture { color: var(--tenue); font-size: 12px; white-space: nowrap; }
.panel-picker { position: relative; }
#panels-menu { position: absolute; top: 100%; left: 0; z-index: 20; display: grid; gap: 4px;
  width: max-content; max-width: 90vw; padding: 8px; background: var(--panel); border: 1px solid var(--borde); }
#panels-menu button { text-align: left; }
/* Hide «−» buttons: white, bordered and double size so they stand out (owner, b33 review). */
#hide-vix, #hide-tpo, #hide-combo-next, #hide-abs-total, #hide-abs-next {
  font-size: 22px; line-height: 16px; padding: 0 4px; color: #fff; background: transparent; border: 1px solid #fff; }
/* The abs «−» floats left of its title; a fixed indent keeps the title at two lines (a flex button made three). */
.panel-title { position: relative; display: block; padding-left: 26px; }
/* z-index above the drag grip (.asa, 10): the first title's left edge sits under the previous box's grip. */
.panel-title > button { position: absolute; top: 0; left: 1px; z-index: 11; }
#abs-box .tres { grid-template-columns: repeat(var(--abs-count, 3), minmax(0, 1fr)); }
.zoom-strikes { display: inline-flex; align-items: center; gap: 6px; color: var(--tenue); font-size: 11px; white-space: nowrap; }
.zoom-strikes input { width: 105px; margin: 0; padding: 0; border: 0; background: transparent; accent-color: #47d9d0; cursor: pointer; }
.zoom-strikes output { min-width: 26px; color: var(--texto); font-variant-numeric: tabular-nums; }
/* S23 box headers, on both pages since VPS P1 (odd/tasks/panel-vps-produccion.md): each zoom on a second line of its
   own box header and the session title on its own header line, on the left. Every box header is 46 px (.caja; the
   canvases still start where the chart pane starts), so the two 18/16 px lines keep a 4 px empty band around them. */
#session-label { margin-left: 0; flex-basis: 100%; color: #f5c542; font-weight: 700; font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
.cab.zoom { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 18px 16px; gap: 4px 8px; align-content: center; padding: 4px 8px; }
.cab.zoom .zoom-strikes { grid-column: 1 / -1; gap: 4px; font-size: 10px; line-height: 16px; }
.cab.zoom .zoom-strikes input { width: 70px; height: 16px; }
.cab.zoom .interruptor { justify-self: start; }
/* Absolute Gamma: three titles over the same thirds as the canvases, then one shared zoom, still within 46 px. */
.cab.tres.zoom { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 24px 16px; gap: 2px 0; padding: 1px 0; }
/* Each title fills its 24 px row so its «−» sits top left even when the title is one line (owner, b35 review). */
.cab.tres.zoom > span { max-height: 24px; overflow: hidden; align-self: stretch; }
.cab.tres.zoom .zoom-strikes { justify-self: center; font-weight: normal; letter-spacing: normal; }
:focus-visible { outline: 2px solid #8edbff; outline-offset: 2px; }
[hidden] { display: none !important; }
#notice { margin: 0; padding: 0 16px; color: var(--tenue); font-size: 12px; overflow-wrap: anywhere; }
#notice:empty { display: none; }
#login { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; padding: 1rem 16px; }
label { display: grid; gap: .3rem; }
input { font: inherit; padding: .4rem; background: var(--fondo); color: var(--texto); border: 1px solid #40516a; border-radius: 4px; }
#login button { font-size: 13px; padding: .45rem 1rem; }
/* S17/S22: TPO | Absolute Gamma | NET OI profile | price | GEX profile. Every box has the same header height, so the
   profiles' canvases start where the chart pane starts and share its price scale. */
main { display: grid; grid-template-columns: var(--ancho-vix, 380px) var(--ancho-tpo, 160px) var(--ancho-abs, 285px) var(--ancho-netoi, 200px) minmax(0, 1fr) var(--ancho-gex, 200px); height: calc(100vh - 84px); min-height: 460px;
  border-bottom: 1px solid var(--borde); }
.caja { position: relative; display: grid; grid-template-rows: 46px minmax(0, 1fr); min-width: 0; min-height: 0; border-right: 1px solid var(--borde); }
.caja:last-child { border-right: 0; border-left: 1px solid var(--borde); }
.cab { display: flex; align-items: center; gap: 10px; padding: 0 8px; border-bottom: 1px solid var(--borde);
  color: var(--tenue); font-size: 11px; white-space: nowrap; overflow: hidden; }
.cab .titulo { color: var(--texto); font-weight: 800; letter-spacing: 1.5px; }
/* b40: mark when TRACE's price zoom was too tight to capture every strike; b42 (owner): blinks once per second. */
/* Nested in the title (not a grid item of .cab.zoom) and only «⚠», so the 200 px headers keep their two rows. */
/* b41 (owner): double size and intense yellow so the «!» inside the triangle reads; line-height keeps the 18 px row. */
.aviso-zoom { margin-left: 4px; font-size: 20px; line-height: 18px; vertical-align: -3px; font-weight: 600; letter-spacing: 0; color: #ffd400; cursor: help;
  animation: parpadeo-zoom 1s steps(1, end) infinite; }
@keyframes parpadeo-zoom { 50% { opacity: 0; } }
.aviso-zoom[hidden] { display: none; }
/* TPO header: title, 1 | 2 and POC on the first line, VAH/VAL on the second, within the common 34 px. */
.cab.tpo { display: grid; grid-template-columns: auto auto 1fr; column-gap: 8px; align-content: center; line-height: 15px; }
.cab.tpo .botones button { padding: 0 6px; font-size: 10px; line-height: 13px; }
#tpo-info, #tpo-va { font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
#tpo-va { grid-column: 1 / -1; }
.cab.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; padding: 0; text-align: center; white-space: normal;
  color: var(--texto); font-weight: 800; font-size: 10px; line-height: 12px; letter-spacing: .5px; }
.cab.tres span + span { border-left: 1px solid var(--borde); }
.cuerpo { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.cuerpo.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.cuerpo.tres .lienzo + .lienzo { border-left: 1px solid var(--borde); }
.lienzo { position: relative; min-height: 0; overflow: hidden; }
.lienzo canvas { position: absolute; left: 0; top: 0; }
#chart { position: relative; }
/* NET OI hover is derived only from the existing validated column overlays. It must not eat pointer events. */
.netoi-hover { position: absolute; left: calc(100% - 6px); width: max-content; max-width: 250px; z-index: 12;
  pointer-events: none; white-space: pre-line; background: #222b39; color: #edf2f7; border: 1px solid #586b82;
  border-radius: 4px; padding: 7px 9px; font: 11px/1.35 system-ui; box-shadow: 0 2px 10px #0009; }
/* The Gamma box sits on the right edge: its hover opens to the left, over the price chart. */
.gex-hover { left: auto; right: calc(100% - 6px); }
/* Free vertical cursor with the NY · Spain time under the plot (the library one snaps to 5-min bars). */
.cursor-v { position: absolute; top: 0; width: 0; border-left: 1px dashed #9598a1; pointer-events: none; z-index: 4; }
.cursor-v.oculto { display: none; }
.cursor-v span { position: absolute; left: 0; transform: translateX(-50%); padding: 2px 6px; border-radius: 2px;
  background: #363c4e; color: #e6edf3; font-size: 11px; white-space: nowrap; }
/* Draggable line on the right border of a box, like the desktop: lit on hover and while dragging. */
.asa { position: absolute; top: 0; bottom: 0; right: -4px; width: 7px; z-index: 10; cursor: col-resize; touch-action: none; }
.asa:hover, .asa.activa { background: rgba(111, 168, 255, 0.35); }
/* SPX only: triple the strip/grip around the same boundary without changing box widths. */
.spx-panel .asa { right: -11px; width: 21px; }
.spx-panel .asa::before { content: ""; position: absolute; top: 0; bottom: 0; left: 9px; width: 3px; background: var(--borde); pointer-events: none; }
.spx-panel .asa:hover::before, .spx-panel .asa.activa::before { background: #6fa8ff; }
/* Switch like the SpotGamma TRACE toggle: green track with the knob on the right when on. */
.interruptor { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none; border: 0;
  color: var(--texto); font-size: 11px; font-weight: 700; }
.interruptor .pista { position: relative; width: 30px; height: 16px; border-radius: 8px; background: #3a4553; transition: background .15s; }
.interruptor .pista::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: #e6edf3; transition: left .15s; }
.interruptor[aria-checked="true"] .pista { background: #1fa37a; }
.interruptor[aria-checked="true"] .pista::after { left: 16px; }
.interruptor:disabled { opacity: .45; cursor: default; }
.capa { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
/* S23: VIX box header and level names, like the desktop (index.html .nombre-nivel-vix). */
#vix-precio { color: var(--texto); font-weight: 700; }
#vix-cambio.sube { color: #2fbf71; }
#vix-cambio.baja { color: #e5484d; }
.nombre-nivel-vix { position: absolute; left: 4px; z-index: 2; font-size: 7px; font-weight: 700; line-height: 1.3; padding: 0 3px;
  border-radius: 2px; color: #0f141b; white-space: nowrap; pointer-events: none; transform: translateY(-50%); }
.nombre-nivel-vix.cerca { outline: 1px solid #e6edf3; }
.nombre-nivel { position: absolute; left: 12px; font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 3px;
  color: #0f141b; white-space: nowrap; transform: translateY(-50%); }
/* Keep the NY opening mark clipped to the price pane; no extrema segments or notices. */
.niveles-sesion { inset: auto; left: 0; top: 0; overflow: hidden; }
.flujo { position: absolute; top: 0; width: 0; border-left: 1px dashed; }
.flujo span { position: absolute; left: 4px; padding: 1px 4px; background: var(--fondo); border: 1px solid currentColor;
  border-radius: 3px; font-size: 9px; font-weight: 800; line-height: 12px; white-space: nowrap; }
/* The vendored chart injects this rule as an inline <style>, which the CSP blocks: same rule from here. */
a#tv-attr-logo { --fill: #131722; --stroke: #fff; position: absolute; left: 10px; bottom: 10px; height: 19px; width: 35px;
  margin: 0; padding: 0; border: 0; z-index: 3; }
a#tv-attr-logo[data-dark] { --fill: #D1D4DC; --stroke: #131722; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 6px 16px; color: var(--tenue); font-size: 12px; }
footer a { color: var(--tenue); }
/* b47 (owner): the source text left the header for the footer, right beside the session text. */
footer #source { margin-right: auto; }
/* Repetición, local page only (odd/tasks/panel-web-repeticion.md): the desktop amber header and pill (index.html). */
#replay-toggle { border-color: #b7791f; color: var(--texto); }
#replay-pill { font-weight: 700; padding: 1px 8px; border-radius: 4px; background: #b7791f; color: #fff; white-space: nowrap; }
#replay-pill:empty, #replay-state:empty { display: none; }
#pagina[data-replay="si"] header { background: #2a2110; }
#pagina:not([data-replay="si"]) .replay-only { display: none; }
/* Repetición: one window high, the boxes take what is left, so the bottom bar never leaves the screen (T3b). */
#pagina[data-replay="si"] { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#pagina[data-replay="si"] main { flex: 1 1 auto; height: auto; min-height: 0; }
#pagina[data-replay="si"] footer { flex: none; }
#replay-day { display: inline-flex; gap: 4px; }
#replay-date { color: var(--texto); min-width: 9em; }
#replay-state { color: #f5c542; font-size: 12px; }
#replay-clock { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
#replay-bar { flex: 1; accent-color: #b7791f; }
#replay-time { color: var(--texto); font-weight: 700; white-space: nowrap; }
.replay-calendar { position: absolute; z-index: 10; left: 16px; padding: 8px; background: var(--panel);
  border: 1px solid #b7791f; border-radius: 4px; font-size: 12px; }
.replay-calendar .mes { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.replay-calendar .cabs, .replay-calendar .semana { display: grid; grid-template-columns: repeat(7, 2.2em); gap: 2px; }
.replay-calendar .cab, .replay-calendar .dia { text-align: center; padding: 3px 0; }
.replay-calendar .cab { color: var(--tenue); }
.replay-calendar .dia.apagado { color: #3a4552; }
.replay-calendar button.dia { padding: 3px 0; color: var(--texto); }
.replay-calendar button.dia.elegido { background: #b7791f; color: #fff; }
#private { padding: 0 16px 1rem; }
#private h2 { font-size: 15px; margin: .8rem 0 .3rem; }
#private p { color: var(--tenue); font-size: 12px; margin: 0 0 .6rem; }
#levels { display: flex; flex-wrap: wrap; gap: 1rem; }
#levels form { flex: 1 1 200px; padding: .6rem; border-top: 3px solid; display: grid; gap: .4rem; }
#levels input { width: 100%; }
#levels button, #clear { font-size: 12px; padding: .35rem .8rem; }
.level-0 { border-color: violet !important; }
.level-1 { border-color: red !important; }
.level-2 { border-color: orange !important; }
.level-3 { border-color: green !important; }
#clear { margin-top: .8rem; }
@media (max-width: 1500px) { main, .spx-panel { grid-template-columns: var(--track-tpo, var(--ancho-tpo, 160px)) var(--track-abs, var(--ancho-abs, 285px)) var(--ancho-netoi, 200px) minmax(0, 1fr) var(--ancho-gex, 200px); } #vix-box { display: none; } }
@media (max-width: 1100px) { main, .spx-panel { grid-template-columns: 160px minmax(0, 1fr) 160px; } #vix-box, #tpo-box, #abs-box { display: none; } }
@media (max-width: 700px) { main, .spx-panel { grid-template-columns: 1fr; height: 70vh; } #vix-box, #tpo-box, #abs-box, #netoi-box, #gex-box, .zoom-strikes { display: none; } }
/* One permanent price track takes the width released by optional panels.
   All profiles retain the same 46px header and price origin. */
.spx-panel {
  grid-template-columns: var(--track-vix, var(--ancho-vix, 380px)) var(--track-tpo, var(--ancho-tpo, 160px))
    var(--track-abs, var(--ancho-abs, 285px)) var(--track-netoi, var(--ancho-netoi, 200px))
    minmax(0, 1fr) var(--track-gex, var(--ancho-gex, 200px));
}
@media (max-width: 1500px) { .spx-panel { --track-vix: ; } }
@media (max-width: 1100px) { .spx-panel {
  --track-tpo: ; --track-abs: ; --track-netoi: var(--ancho-netoi, 160px); --track-gex: var(--ancho-gex, 160px);
} }
@media (max-width: 700px) { .spx-panel { --track-netoi: ; --track-gex: ; } }
