:root {
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --bg-3: #eceef2;
  --line: #e2e5ea;
  --line-2: #d3d7de;
  --ink: #16191f;
  --ink-2: #4a5160;
  --ink-3: #7d8594;
  --accent: #1f6feb;
  --accent-2: #e5483b;
  --chip: rgba(18, 20, 24, 0.92);
  --chip-ink: #ffffff;
  --sidebar-w: 330px;
  --topbar-h: 44px;
  --timebar-h: 56px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.ui-dark {
  --bg: #15181d; --bg-2: #1c2026; --bg-3: #252a32; --line: #2c323b; --line-2: #39404b;
  --ink: #e8ebf0; --ink-2: #b2b9c5; --ink-3: #7f8896;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 13px/1.35 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

#app { display: grid; height: 100%; grid-template-rows: var(--topbar-h) 1fr var(--timebar-h); grid-template-columns: 0 1fr; grid-template-areas: "top top" "side main" "time time"; transition: grid-template-columns .18s ease; }
#app.sidebar-open { grid-template-columns: var(--sidebar-w) 1fr; }

/* ------------------------------------------------------------------ top bar */
#topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 5; }
.tb-left, .tb-right, .tb-center { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-center { flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 500; letter-spacing: .2px; margin-right: 6px; white-space: nowrap; }
.brand b { font-weight: 700; color: var(--accent); }
.logo { width: 22px; height: 22px; color: var(--accent); stroke-width: 2.4; }
.tb-nav a { color: var(--accent); text-decoration: none; font-weight: 600; padding: 4px 8px; border-radius: 5px; }
.tb-nav a:hover { background: var(--bg-2); }
.run-pill { font: 500 12px var(--mono); color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 99px; white-space: nowrap; cursor: pointer; }
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bg-2); border-color: var(--line); }
.icon-btn.on { background: var(--ink); color: var(--bg); }
.icon-btn.accent { color: var(--accent-2); }
.preset { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 4px 11px; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.preset:hover { border-color: var(--ink-3); color: var(--ink); }
.preset.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ------------------------------------------------------------------ sidebar */
#sidebar { grid-area: side; overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); min-width: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; flex: none; }
.tab { flex: 1; border: 0; background: none; padding: 10px 4px 9px; font-weight: 600; font-size: 12.5px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-body { flex: 1; overflow-y: auto; padding: 12px; scrollbar-width: thin; }
.sec { margin-bottom: 16px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); margin: 2px 0 8px; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.row > label, .lbl { flex: 0 0 112px; color: var(--ink-2); font-size: 12px; }
.row .grow { flex: 1; min-width: 0; }
.row input[type=range] { flex: 1; accent-color: var(--accent); }
.row .val { font: 11px var(--mono); color: var(--ink-3); width: 38px; text-align: right; }
input[type=number], input[type=text], select, textarea { background: var(--bg); border: 1px solid var(--line-2); border-radius: 5px; padding: 4px 6px; font-size: 12px; min-width: 0; }
input[type=number] { width: 72px; font-family: var(--mono); }
select { padding: 4px 4px; }
input[type=color] { width: 30px; height: 24px; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px; background: var(--bg); cursor: pointer; }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--accent); margin: 0; }
.btn { border: 1px solid var(--line-2); background: var(--bg); border-radius: 6px; padding: 5px 10px; font-weight: 500; font-size: 12px; cursor: pointer; }
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 3px 7px; font-size: 11.5px; }
.btn.block { width: 100%; }
.muted { color: var(--ink-3); font-size: 12px; }
.note { background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; color: var(--ink-2); font-size: 12px; }
.note code, .mono { font-family: var(--mono); font-size: 11.5px; }

.panel-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pchip { border: 1px solid var(--line-2); background: var(--bg); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.pchip.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }

/* layer cards */
.layer { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--bg); overflow: hidden; }
.layer.off { opacity: .55; }
.layer-h { display: flex; align-items: center; gap: 6px; padding: 7px 8px; cursor: pointer; }
.layer-h:hover { background: var(--bg-2); }
.layer-h .name { flex: 1; min-width: 0; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-h .name small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.badge { font: 600 10px var(--mono); text-transform: uppercase; padding: 2px 5px; border-radius: 4px; background: var(--bg-3); color: var(--ink-2); letter-spacing: .3px; }
.badge.fill { background: #e7f0ff; color: #1f5fc8; }
.badge.contour { background: #f1e9ff; color: #6b3fc4; }
.badge.vector { background: #e6f6ec; color: #20844a; }
.ui-dark .badge.fill { background: #1d2c47; color: #8db7ff; }
.ui-dark .badge.contour { background: #2c2147; color: #c3a6ff; }
.ui-dark .badge.vector { background: #183324; color: #7fd6a2; }
.mini { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 4px; cursor: pointer; color: var(--ink-3); padding: 0; }
.mini:hover { background: var(--bg-3); color: var(--ink); }
.mini svg { width: 14px; height: 14px; }
.layer-b { padding: 4px 10px 10px; border-top: 1px solid var(--line); background: var(--bg-2); }
.swatch { height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.12); flex: 1; }
.pal-row { display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------ panels */
#panels { grid-area: main; position: relative; display: grid; gap: 2px; background: var(--line-2); min-height: 0; min-width: 0; }
#panels.layout-1 { grid-template: 1fr / 1fr; }
#panels.layout-2v { grid-template: 1fr / 1fr 1fr; }
#panels.layout-2h { grid-template: 1fr 1fr / 1fr; }
#panels.layout-3 { grid-template: 1fr 1fr / 1.4fr 1fr; }
#panels.layout-3 .panel:first-child { grid-row: span 2; }
#panels.layout-4 { grid-template: 1fr 1fr / 1fr 1fr; }
.panel { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: #dfe3e8; }
.panel .map { position: absolute; inset: 0; }
.panel.active::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--accent); pointer-events: none; z-index: 4; }
#panels.layout-1 .panel.active::after { display: none; }
.cbars { position: absolute; top: 0; left: 0; right: 0; display: flex; z-index: 3; pointer-events: none; }
.cbar { flex: 1; position: relative; height: 34px; pointer-events: auto; cursor: pointer; min-width: 0; }
.cbar + .cbar { border-left: 2px solid rgba(255,255,255,.85); }
.cbar .grad { position: absolute; left: 0; right: 0; top: 0; height: 15px; }
.cbar .ticks { position: absolute; left: 0; right: 0; top: 0; height: 15px; font: 600 11.5px var(--sans); color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.cbar .ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; line-height: 15px; }
.cbar .ticks span.first { transform: none; left: 4px !important; }
.cbar .ticks span.last { transform: translateX(-100%); }
.cbar .title { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--chip); color: var(--chip-ink); font-weight: 600; font-size: 13px; padding: 2px 9px 3px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.cbar:hover .title { background: #000; }
.infobox { position: absolute; left: 10px; bottom: 10px; z-index: 3; background: rgba(16,18,22,.86); color: #fff; padding: 7px 11px 8px; border-radius: 6px; max-width: calc(100% - 140px); pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.infobox .t1 { font-weight: 700; font-size: 16px; line-height: 1.25; }
.infobox .t2 { font-weight: 600; font-size: 13.5px; line-height: 1.35; font-family: var(--sans); opacity: .95; }
.panel.compact .infobox .t1 { font-size: 13px; }
.panel.compact .infobox .t2 { font-size: 11.5px; }
.panel.compact .cbar .title { font-size: 11.5px; }
.wm { position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 74px; height: 74px; border-radius: 10px; background: rgba(255,255,255,.88); display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.2); pointer-events: none; }
.wm svg { width: 56px; height: 56px; color: #1b1e24; stroke-width: 2.2; }
.wm span { position: absolute; top: 4px; font: 700 10px var(--sans); color: #1b1e24; letter-spacing: .2px; }
.panel.compact .wm { width: 50px; height: 50px; } .panel.compact .wm svg { width: 38px; height: 38px; } .panel.compact .wm span { display:none; }
.loading { position: absolute; top: 44px; right: 10px; z-index: 3; background: rgba(16,18,22,.8); color: #fff; font-size: 11.5px; padding: 3px 8px; border-radius: 99px; }
.panel-tag { position: absolute; top: 40px; left: 8px; z-index: 3; font: 700 11px var(--mono); background: rgba(255,255,255,.9); color: #222; border-radius: 4px; padding: 1px 5px; pointer-events: none; }
#panels.layout-1 .panel-tag { display: none; }
.maplibregl-ctrl-group { border-radius: 6px !important; }
.maplibregl-ctrl-scale { background: rgba(255,255,255,.75) !important; font-size: 10.5px !important; }

/* ------------------------------------------------------------------ timebar */
#timebar { grid-area: time; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--bg); border-top: 1px solid var(--line); z-index: 5; }
.tb-time { flex: 0 0 245px; }
.time-label { font-weight: 600; font-size: 13.5px; font-family: var(--sans); white-space: nowrap; }
.time-sub { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; font-family: var(--mono); }
.tb-controls { display: flex; gap: 3px; }
.ctl { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 50%; cursor: pointer; color: var(--ink); }
.ctl svg { width: 13px; height: 13px; fill: currentColor; stroke-width: 1.2; }
.ctl.play { width: 36px; height: 36px; background: var(--accent); border-color: var(--accent); color: #fff; margin-top: -3px; }
.ctl.play svg { width: 15px; height: 15px; }
.ctl .i-pause { display: none; } .ctl.playing .i-pause { display: block; } .ctl.playing .i-play { display: none; }
.ctl:hover { filter: brightness(.96); }
.timeline { flex: 1; position: relative; height: 38px; cursor: pointer; user-select: none; touch-action: none; }
.tl-track { position: absolute; left: 0; right: 0; top: 9px; height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.tl-track .fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.tl-ticks { position: absolute; left: 0; right: 0; top: 0; height: 100%; }
.tl-ticks .tk { position: absolute; top: 9px; width: 1px; height: 8px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.tl-ticks .tk.major { background: color-mix(in srgb, var(--ink) 45%, transparent); }
.tl-ticks .lb { position: absolute; top: 21px; transform: translateX(-50%); font: 10.5px var(--mono); color: var(--ink-3); white-space: nowrap; }
.tl-ticks .lb.day { color: var(--ink); font-weight: 600; }
.tl-handle { position: absolute; top: 5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.3); pointer-events: none; }
.tl-hover { position: absolute; top: -22px; transform: translateX(-50%); background: var(--chip); color: #fff; font: 11px var(--mono); padding: 2px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
.tb-opts { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ overlays */
#tooltip { position: fixed; z-index: 30; pointer-events: none; background: rgba(16,18,22,.93); color: #fff; padding: 6px 9px; border-radius: 6px; font-size: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.3); min-width: 150px; }
#tooltip .ll { font: 10.5px var(--mono); opacity: .65; margin-bottom: 3px; }
#tooltip .r { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
#tooltip .r b { font-family: var(--mono); font-weight: 500; }
#tooltip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
#meteogram { position: absolute; right: 12px; bottom: calc(var(--timebar-h) + 12px); z-index: 20; width: 440px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.18); padding: 10px 12px 8px; }
#meteogram .mh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#meteogram .mh b { flex: 1; font-size: 13px; }
#meteogram svg text { fill: var(--ink-3); stroke: none; font: 10px var(--mono); }
#modal-root .backdrop { position: fixed; inset: 0; background: rgba(10,12,16,.45); z-index: 40; display: grid; place-items: center; }
.modal { background: var(--bg); border-radius: 12px; width: min(720px, 94vw); max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 15px; }
.modal-b { padding: 12px 16px 16px; overflow-y: auto; }
.cat { margin-bottom: 12px; }
.cat h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); }
.var-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.var-row:hover { background: var(--bg-2); }
.var-row .vn { flex: 1; min-width: 0; }
.var-row .vn b { font-weight: 600; } .var-row .vn small { color: var(--ink-3); margin-left: 6px; font-family: var(--mono); }
.var-row .vd { display: block; color: var(--ink-3); font-size: 11.5px; }
.stops { display: grid; grid-template-columns: 1fr 34px 24px; gap: 6px; align-items: center; }
.snapshot img { max-width: 100%; border-radius: 6px; border: 1px solid var(--line); }
#toast { position: fixed; left: 50%; bottom: calc(var(--timebar-h) + 16px); transform: translateX(-50%) translateY(20px); background: var(--chip); color: #fff; padding: 7px 14px; border-radius: 99px; font-size: 12.5px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.kbd { font: 11px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--bg-2); }

@media (max-width: 860px) {
  #app.sidebar-open { grid-template-columns: 0 1fr; }
  #app.sidebar-open.mobile-side #sidebar { position: fixed; top: var(--topbar-h); bottom: var(--timebar-h); left: 0; width: min(330px, 92vw); z-index: 25; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  .tb-center, .brand span, .run-pill, .tb-opts, .tb-nav { display: none; }
  .tb-time { flex-basis: 150px; } .time-label { font-size: 12px; }
  #meteogram { width: calc(100vw - 24px); }
}

.xhair { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,.75); z-index: 3; pointer-events: none; }
.maplibregl-ctrl-top-right { top: 38px !important; }
.maplibregl-ctrl-bottom-right { bottom: 92px !important; }
.panel.compact .maplibregl-ctrl-bottom-right { bottom: 66px !important; }

.pbar { height: 6px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.pbar i.indet { width: 35% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.frow { display: flex; gap: 8px; align-items: center; padding: 3px 8px; border-bottom: 1px solid var(--line); font-size: 11px; }
.frow:last-child { border-bottom: 0; }
.frow > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fst { font: 600 10px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--bg-3); color: var(--ink-2); white-space: nowrap; }
.fst.procesado { background: #e6f6ec; color: #20844a; } .fst.descargando { background: #e7f0ff; color: #1f5fc8; } .fst.error { background: #fde8e6; color: #b3261e; }
#btn-drive.busy { color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.picker { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pk-bar { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-bottom: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; }
.pk-bar .pchip { padding: 2px 9px; }
.pk-list { max-height: 260px; overflow: auto; }
.pk-row { cursor: pointer; } .pk-row:hover { background: var(--bg-2); } .pk-row.off > span { opacity: .45; }
.pk-row input { margin: 0; accent-color: var(--accent); }
.pk-sum { padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 12px; }

.catalog { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: var(--bg); overflow: hidden; }
.catalog #cat-search { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 10px; font-size: 12.5px; }
.catalog #cat-search:focus { outline: none; background: var(--bg-2); }
.cv-cat + .cv-cat, .catalog > .cv-cat:first-of-type { border-top: 1px solid var(--line); }
.cv-head { padding: 7px 10px; font-weight: 600; font-size: 12px; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.cv-head:hover { background: var(--bg-2); }
.cv-head small { color: var(--ink-3); font-weight: 400; margin-left: auto; }
.cv-caret { width: 10px; color: var(--ink-3); }
.cv-body { display: none; padding-bottom: 4px; }
.cv-cat.open .cv-body, .cv-cat.searching .cv-body { display: block; }
.cv-row { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 4px; }
.cv-row:hover { background: var(--bg-2); }
.cv-name { flex: 1; min-width: 0; font-size: 12px; line-height: 1.25; }
.cv-name small { display: block; color: var(--ink-3); font-size: 10.5px; font-family: var(--mono); }
.cv-row.miss { opacity: .55; }
.cv-row.miss .cv-name small { font-family: var(--sans); }
.cv-star { width: 20px; border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 13px; padding: 0; }
.cv-star.on { color: #e3a008; }
.cv-btn { border: 1px solid var(--line-2); background: var(--bg); border-radius: 4px; font-size: 10.5px; padding: 1px 5px; cursor: pointer; color: var(--ink-2); }
.cv-btn:hover { border-color: var(--accent); color: var(--accent); }

.hodo-ov { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hodo-key { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(255,255,255,.92); border-radius: 5px; padding: 2px 9px; font: 600 11.5px var(--sans); color: #333; box-shadow: 0 1px 4px rgba(0,0,0,.2); white-space: nowrap; pointer-events: none; }
.cbars:empty + .hodo-key { top: 8px; }

/* ---------------------------------------------------------------- sondeos */
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
#sounding { position: absolute; right: 12px; top: calc(var(--topbar-h) + 10px); z-index: 25; width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - var(--topbar-h) - var(--timebar-h) - 24px); overflow: auto; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
#sounding .snd-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: move; user-select: none; position: sticky; top: 0; background: var(--bg); z-index: 1; flex-wrap: wrap; }
#sounding .snd-h b { font-size: 13px; }
#sounding .snd-h .muted { flex: 1; font-size: 12px; }
#sounding .seg, #rpick .seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
#sounding .seg button, #rpick .seg button { flex: 1; border: 0; background: transparent; color: var(--ink-2); font: 600 11.5px var(--sans); padding: 4px 9px; cursor: pointer; }
#sounding .seg button + button, #rpick .seg button + button { border-left: 1px solid var(--line-2); }
#sounding .seg button.on, #rpick .seg button.on { background: var(--ink); color: var(--bg); }
#sounding .chk { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
#sounding .snd-b { padding: 8px 10px 10px; }
#sounding .snd-grid { display: grid; grid-template-columns: minmax(0, 560fr) minmax(0, 320fr); gap: 10px; align-items: start; }
#sounding .snd-side svg { border: 1px solid var(--line); border-radius: 6px; }
#sounding .snd-skew svg { border: 1px solid var(--line); border-radius: 6px; }
#sounding .snd-t { width: 100%; border-collapse: collapse; margin-top: 8px; font: 11px var(--mono); table-layout: auto; }
#sounding .snd-t th, #sounding .snd-t td { padding: 2px 4px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
#sounding .snd-t th { color: var(--ink-3); font-weight: 600; }
#sounding .snd-t.kv th { text-align: left; white-space: normal; font-weight: 500; }
#sounding .snd-t.kv td { white-space: nowrap; }
#sounding .snd-t.kv td { text-align: left; color: var(--ink); }
#sounding .snd-foot { font-size: 11px; margin-top: 6px; }
#sounding .snd-img { width: 100%; display: block; border-radius: 6px; }
#sounding .snd-wait, #sounding .snd-msg { padding: 30px 16px; text-align: center; color: var(--ink-2); line-height: 1.5; }
#sounding .snd-msg { text-align: left; }
.snd-mk { width: 14px; height: 14px; transform: rotate(45deg); background: #1f6feb; border: 2px solid #fff; box-shadow: 0 0 0 1px #000; }
.snd-st { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.snd-st i { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid #1f6feb; filter: drop-shadow(0 0 1px #000); }
.snd-st span { font: 600 11px var(--sans); color: #111; background: rgba(255,255,255,.85); padding: 0 4px; border-radius: 3px; margin-top: 1px; order: 2; }
@media (max-width: 760px) {
  #sounding { left: 6px; right: 6px; width: auto; top: calc(var(--topbar-h) + 4px); }
  #sounding .snd-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- corte vertical */
#xsect { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--timebar-h) + 10px); z-index: 24;
  width: min(1100px, calc(100vw - 24px)); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); }
#xsect[style*="left"] { transform: none; }
#xsect .xs-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: move; user-select: none; flex-wrap: wrap; }
#xsect .xs-h b { font-size: 13px; }
#xsect .xs-h .muted { font-size: 12px; }
#xsect .xs-h select { font-size: 12px; }
#xsect #xs-field { max-width: 230px; }
#xsect .xs-ov { display: inline-flex; gap: 8px; flex: 1; justify-content: flex-end; }
#xsect .xs-ov .chk { font-size: 12px; display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
#xsect .xs-b { position: relative; padding: 6px 8px 0; }
#xsect canvas { width: 100%; height: min(42vh, 420px); display: block; cursor: crosshair; }
#xsect .xs-read { position: absolute; background: var(--chip); color: var(--chip-ink); font: 11.5px var(--mono); padding: 4px 7px; border-radius: 5px; pointer-events: none; white-space: nowrap; }
#xsect .xs-wait { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.55); font-size: 13px; color: var(--ink-2); }
#xsect .xs-legend { display: flex; align-items: center; gap: 8px; padding: 4px 10px 0; font-size: 11.5px; color: var(--ink-2); }
#xsect .xs-legend i { flex: 0 0 220px; height: 9px; border-radius: 3px; border: 1px solid var(--line-2); }
#xsect .xs-foot { font-size: 11px; padding: 3px 10px 8px; }
.xs-mk { width: 22px; height: 22px; border-radius: 50%; background: #111; color: #fff; font: 700 12px var(--sans); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 0 1px #000; cursor: grab; }
@media (max-width: 760px) { #xsect .xs-ov { justify-content: flex-start; } #xsect canvas { height: 34vh; } }

/* sitio público (VPS) y corrida en curso */
body.public #btn-drive, body.public .admin-only { display: none !important; }
.run-pill.live::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: #e5484d; vertical-align: 1px; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
