/* ════════════════════════════════════════════════════════════
   OMNITRON — panel móvil (mismo lenguaje visual que la app de escritorio)
   ════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Orbitron'; font-weight: 500; font-display: swap; src: url('/fuentes/orbitron-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-weight: 700; font-display: swap; src: url('/fuentes/orbitron-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 500; font-display: swap; src: url('/fuentes/rajdhani-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url('/fuentes/rajdhani-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url('/fuentes/rajdhani-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('/fuentes/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-display: swap; src: url('/fuentes/jetbrains-mono-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #04060b;
  --linea: rgba(110, 200, 255, 0.12);
  --linea-f: rgba(120, 215, 255, 0.28);
  --texto: #dbe8f4;
  --tenue: #8397ad;
  --apagado: #53667a;
  --cian: #3cf0ff;
  --cian-rgb: 60, 240, 255;
  --ambar: #ffb547;
  --ambar-rgb: 255, 181, 71;
  --rojo: #ff4d6d;
  --rojo-rgb: 255, 77, 109;
  --acero-rgb: 111, 132, 156;
  --violeta-rgb: 138, 125, 255;
  --f-display: 'Orbitron', system-ui, sans-serif;
  --f-ui: 'Rajdhani', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--texto);
  font-family: var(--f-ui);
  font-size: 16px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ─── fondo ─── */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 420px at 0% -8%, rgba(0, 190, 230, 0.2), transparent 62%),
    radial-gradient(600px 520px at 110% 110%, rgba(var(--violeta-rgb), 0.16), transparent 60%),
    linear-gradient(180deg, #060a14, #03050a);
}
.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(90, 190, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(90, 190, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 20%, #000 25%, transparent 85%);
}
.bg-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 3px); }

/* ─── vistas ─── */
.vista { display: none; }
body[data-vista='cargando'] #v-cargando,
body[data-vista='entrar'] #v-entrar,
body[data-vista='vincular'] #v-vincular { display: flex; }
body[data-vista='panel'] #v-panel { display: block; }

.vista-centro {
  min-height: 100vh; min-height: 100dvh;
  flex-direction: column; align-items: center; justify-content: center; gap: 34px;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
}

.emblema { width: 92px; height: 92px; color: var(--cian); filter: drop-shadow(0 0 18px rgba(var(--cian-rgb), 0.6)); }
.emblema path, .emblema-mini path { fill: none; stroke: currentColor; stroke-width: 3; }
.emblema circle, .emblema-mini circle { fill: currentColor; }
.pulso { animation: pulso 1.4s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: 0.35; transform: scale(0.94); } }

.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.marca { margin: 6px 0 0; font-family: var(--f-display); font-weight: 700; font-size: 28px; letter-spacing: 0.34em; padding-left: 0.34em; }
.sub { margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--tenue); }

.caja { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.nota { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--tenue); text-align: center; }
.nota b { color: var(--texto); font-weight: 600; }
.aviso {
  margin: 0; padding: 11px 14px; font-size: 15px; line-height: 1.35;
  border-left: 3px solid var(--ambar); background: rgba(var(--ambar-rgb), 0.08); color: #ffe2b3;
}
.aviso.error { border-color: var(--rojo); background: rgba(var(--rojo-rgb), 0.08); color: #ffc2cd; }

.campo { display: flex; flex-direction: column; gap: 8px; }
.campo span { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.18em; color: var(--apagado); }
.campo input {
  height: 50px; padding: 0 14px; border: 1px solid var(--linea-f); background: rgba(0, 0, 0, 0.35);
  font-size: 18px; font-weight: 600; outline: none; border-radius: 0;
}
.campo input:focus { border-color: rgba(var(--cian-rgb), 0.7); box-shadow: 0 0 0 3px rgba(var(--cian-rgb), 0.14); }

/* ─── CTA ─── */
.cta-wrap { filter: drop-shadow(0 0 14px rgba(var(--cian-rgb), 0.25)); }
.cta-ambar { filter: drop-shadow(0 0 14px rgba(var(--ambar-rgb), 0.25)); }
.cta {
  --c: 14px;
  position: relative; width: 100%; height: 58px; border: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--f-display); font-weight: 700; font-size: 13.5px; letter-spacing: 0.22em;
  color: #00161b; background: linear-gradient(90deg, #1fd2ec, #6ef8ff 50%, #1fd2ec);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transition: transform 0.1s, filter 0.2s;
}
.cta-ambar .cta { color: #1d1000; background: linear-gradient(90deg, #ff9f1a, #ffcf70 50%, #ff9f1a); }
.cta:active { transform: scale(0.985); }
.cta:disabled { filter: grayscale(1) brightness(0.45); }
.cta::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  transform: translateX(-130%); animation: brillo 5s ease-in-out infinite;
}
@keyframes brillo { 0%, 65% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.cta .ico { width: 20px; height: 20px; stroke-width: 2.1; }
.ocupado .cta { filter: brightness(0.7); pointer-events: none; }

/* ─── panel principal ─── */
#v-panel {
  max-width: 560px; margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.barra { display: flex; align-items: center; gap: 10px; height: 52px; margin-bottom: 10px; }
.emblema-mini { width: 24px; height: 24px; color: var(--cian); filter: drop-shadow(0 0 6px rgba(var(--cian-rgb), 0.6)); }
.barra-marca { font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 0.3em; }
.enlace {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--tenue);
}
.enlace i { width: 7px; height: 7px; border-radius: 50%; background: var(--apagado); }
.enlace.ok { color: var(--cian); }
.enlace.ok i { background: var(--cian); box-shadow: 0 0 8px var(--cian); animation: blip 1.6s ease-in-out infinite; }
@keyframes blip { 50% { opacity: 0.3; } }
.icono-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--linea); background: rgba(120, 170, 220, 0.05); color: var(--tenue);
}

.pcs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; }
.pcs button { flex: none; height: 38px; padding: 0 14px; border: 1px solid var(--linea); background: rgba(120, 170, 220, 0.05); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; }
.pcs button.sel { border-color: rgba(var(--cian-rgb), 0.6); color: var(--cian); }

.panel {
  --cut: 16px; --hl: var(--cian-rgb);
  position: relative; isolation: isolate; padding: 16px 16px 18px; margin-bottom: 14px;
}
.panel::before, .panel::after {
  content: ''; position: absolute; z-index: -2;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.panel::before { inset: 0; background: linear-gradient(155deg, rgba(var(--hl), 0.45), rgba(var(--hl), 0.07) 30%, rgba(110, 150, 200, 0.07) 70%, rgba(var(--violeta-rgb), 0.3)); }
.panel::after { inset: 1px; z-index: -1; background: linear-gradient(180deg, rgba(11, 19, 32, 0.95), rgba(6, 11, 19, 0.95)); }
.panel-protocolo { --hl: var(--ambar-rgb); }
.panel-registro, .panel-pc { --hl: var(--acero-rgb); }

.pc-cab { display: flex; align-items: center; gap: 12px; }
.pc-cab > span .ico { width: 26px; height: 26px; color: var(--tenue); }
.pc-nombre { min-width: 0; }
.pc-nombre h2 { margin: 0; font-family: var(--f-display); font-size: 14px; letter-spacing: 0.14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-nombre p { margin: 2px 0 0; font-size: 14px; color: var(--tenue); }

.chip-estado {
  margin-left: auto; flex: none; position: relative; padding: 6px 10px 6px 22px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--tenue); border: 1px solid var(--linea-f);
}
.chip-estado::before { content: ''; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: currentColor; }
.chip-estado.on { color: var(--cian); border-color: rgba(var(--cian-rgb), 0.45); }
.chip-estado.ambar { color: var(--ambar); border-color: rgba(var(--ambar-rgb), 0.5); }
.chip-estado.rojo { color: var(--rojo); border-color: rgba(var(--rojo-rgb), 0.55); }
.chip-estado.on::before, .chip-estado.ambar::before, .chip-estado.rojo::before { box-shadow: 0 0 8px currentColor; animation: blip 1.6s ease-in-out infinite; }

.tele { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; border: 1px solid var(--linea); background: rgba(0, 0, 0, 0.2); }
.tele div { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; }
.tele div + div { border-left: 1px solid var(--linea); }
.tele span { font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.16em; color: var(--apagado); }
.tele b { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }

.p-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.p-idx { font-family: var(--f-mono); font-size: 10px; font-weight: 600; color: rgb(var(--hl)); border: 1px solid rgba(var(--hl), 0.55); padding: 3px 5px; }
/* Si el título y su estado no caben juntos, el estado baja de renglón (alineado a la derecha) en vez de cortar el título. */
.p-cab { flex-wrap: wrap; row-gap: 8px; }
.p-cab h3 { margin: 0; white-space: nowrap; font-family: var(--f-display); font-size: 13px; letter-spacing: 0.24em; }
.p-cab .chip-estado { white-space: nowrap; }

/* ─── vigilia ─── */
.vg-cuerpo { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.anillo { position: relative; width: 132px; height: 132px; flex: none; }
.anillo svg { width: 100%; height: 100%; }
.a-pista { fill: none; stroke: rgba(120, 160, 200, 0.1); stroke-width: 7; }
.a-progreso {
  fill: none; stroke: rgb(var(--acero-rgb)); stroke-width: 7; transform: rotate(-90deg); transform-origin: 80px 80px;
  transition: stroke-dashoffset 0.95s linear, stroke 0.4s; filter: drop-shadow(0 0 6px rgba(var(--acero-rgb), 0.6));
}
.a-guiones { fill: rgba(0, 0, 0, 0.25); stroke: rgba(120, 200, 255, 0.25); stroke-width: 1.5; stroke-dasharray: 2 6; }
body.vigilia-on .a-progreso { stroke: var(--cian); filter: drop-shadow(0 0 7px rgba(var(--cian-rgb), 0.8)); }
.a-progreso.infinito { animation: giro 2.8s linear infinite; transition: stroke 0.4s; }
@keyframes giro { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
.anillo-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.a-etq { font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.2em; color: var(--tenue); }
.a-tiempo { margin-top: 4px; font-family: var(--f-display); font-weight: 500; font-size: 21px; font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(var(--cian-rgb), 0.45); }
.a-tiempo.inf { font-family: var(--f-ui); font-size: 40px; line-height: 0.8; }
.vg-info { min-width: 0; }
.vg-linea { margin: 0 0 4px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.vg-linea.tenue { font-size: 14px; font-weight: 500; color: var(--tenue); }

.controles { display: flex; flex-direction: column; gap: 9px; }
body.vigilia-on #vg-config, body:not(.vigilia-on) #vg-activa { display: none; }
body.protocolo-on #pr-config, body:not(.protocolo-on) #pr-armado { display: none; }

.etq { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--apagado); }
.etq::before { content: ''; width: 10px; height: 1px; background: rgb(var(--hl)); box-shadow: 0 0 6px rgba(var(--hl), 0.7); }
.etq em { margin-left: auto; font-style: normal; font-family: var(--f-ui); font-size: 14px; letter-spacing: 0; color: var(--tenue); }

.chips { display: grid; gap: 6px; }
.chips-3 { grid-template-columns: repeat(3, 1fr); }
.chips-5 { grid-template-columns: repeat(5, 1fr); }

.chip, .pill, .seg button, .ib, .tile, .btn {
  --c: 8px; --borde: var(--linea);
  border: 1px solid var(--borde); border-radius: 0; background-color: rgba(120, 170, 220, 0.045);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  background-image:
    linear-gradient(135deg, transparent 4.9px, var(--borde) 4.9px, var(--borde) 6.3px, transparent 6.3px),
    linear-gradient(315deg, transparent 4.9px, var(--borde) 4.9px, var(--borde) 6.3px, transparent 6.3px);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip {
  height: 46px; display: flex; align-items: baseline; justify-content: center; gap: 3px; padding-top: 13px;
  font-family: var(--f-display); font-size: 15px; white-space: nowrap;
}
.chip small { font-family: var(--f-mono); font-size: 9px; color: var(--tenue); }
.chip.sel, .pill.sel, .seg button.sel, .tile.sel {
  --borde: rgba(var(--hl), 0.7);
  background-color: rgba(var(--hl), 0.12); color: #fff;
}
.chip.sel { text-shadow: 0 0 10px rgba(var(--hl), 0.8); }
.chip.sel small { color: rgb(var(--hl)); }

.pill { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; }
.pill span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--apagado); }
.pill.sel span { color: rgb(var(--hl)); }
.pill input {
  height: 44px; min-width: 120px; padding: 0 8px; border: 1px solid var(--linea); background: rgba(0, 0, 0, 0.35);
  font-family: var(--f-display); font-size: 16px; text-align: center; outline: none; border-radius: 0;
}

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { height: 44px; font-family: var(--f-display); font-size: 10.5px; letter-spacing: 0.14em; color: var(--tenue); }
.seg button.sel { color: rgb(var(--hl)); }

.iconos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ib { height: 44px; display: grid; place-items: center; color: var(--tenue); }
.ib.sel { --borde: rgba(var(--ambar-rgb), 0.7); color: var(--ambar); background-color: rgba(var(--ambar-rgb), 0.1); }
.ib[data-accion='none'].sel { --borde: var(--linea-f); color: var(--texto); background-color: rgba(120, 170, 220, 0.09); }
.iconos.off { opacity: 0.35; pointer-events: none; }

.cta-wrap { margin-top: 6px; }

.btn {
  height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
  font-family: var(--f-display); font-size: 10.5px; letter-spacing: 0.14em; --borde: var(--linea-f);
  background-color: rgba(120, 170, 220, 0.07);
}
.btn:active { background-color: rgba(120, 200, 255, 0.16); }
.btn-ancho { width: 100%; height: 54px; font-size: 12px; }
.btn-peligro { --borde: rgba(var(--rojo-rgb), 0.6); color: #ff9db0; background-color: rgba(var(--rojo-rgb), 0.08); }
.btn-peligro.confirmar { color: #fff; background-color: rgba(var(--rojo-rgb), 0.55); animation: blip 0.8s ease-in-out infinite; }
.btn-ambar { --borde: rgba(var(--ambar-rgb), 0.6); color: var(--ambar); }

/* ─── protocolo ─── */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile {
  height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--f-display); font-size: 9.5px; letter-spacing: 0.1em;
}
.tile .ico { width: 22px; height: 22px; color: var(--tenue); }
.tile.sel .ico { color: var(--ambar); filter: drop-shadow(0 0 6px rgba(var(--ambar-rgb), 0.8)); }
.resumen {
  margin: 4px 0 0; padding: 10px 12px; border-left: 2px solid var(--ambar);
  background: linear-gradient(90deg, rgba(var(--ambar-rgb), 0.08), transparent);
  font-family: var(--f-mono); font-size: 11.5px; line-height: 1.5; color: var(--tenue);
}
.resumen b { color: var(--ambar); }

.pa-cab { display: flex; align-items: center; gap: 14px; }
.pa-icono {
  --c: 10px; width: 58px; height: 58px; flex: none; display: grid; place-items: center; color: var(--ambar);
  background: rgba(var(--ambar-rgb), 0.1); box-shadow: inset 0 0 0 1px rgba(var(--ambar-rgb), 0.55), inset 0 0 20px rgba(var(--ambar-rgb), 0.2);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.pa-icono .ico { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(var(--ambar-rgb), 0.9)); }
.pa-k { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--ambar); }
.pa-cab h4 { margin: 3px 0 2px; font-family: var(--f-display); font-size: 16px; letter-spacing: 0.16em; }
.pa-cab p { margin: 0; color: var(--tenue); font-size: 15px; }
.pa-cuenta { margin: 6px 0 2px; font-family: var(--f-display); font-weight: 500; font-size: 44px; font-variant-numeric: tabular-nums; color: #ffe9c7; text-shadow: 0 0 22px rgba(var(--ambar-rgb), 0.5); }
.pa-barra { position: relative; height: 4px; overflow: hidden; background: rgba(var(--ambar-rgb), 0.12); }
.pa-barra i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #ff9a12, #ffd585); box-shadow: 0 0 10px rgba(var(--ambar-rgb), 0.8); transition: width 0.9s linear; }
.botones-3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; margin-top: 6px; }
body.alerta .panel-protocolo { --hl: var(--rojo-rgb); }
body.alerta .pa-cuenta { color: #fff; text-shadow: 0 0 26px rgba(var(--rojo-rgb), 0.9); }

/* ─── pantallas ─── */
.panel-salva { --hl: var(--cian-rgb); }
.chips-6 { grid-template-columns: repeat(6, 1fr); }
.chips-6 .chip { font-size: 13px; }
.nota-izq { text-align: left; }

.topos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.topo {
  --c: 8px; --borde: var(--linea);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px;
  border: 1px solid var(--borde); background-color: rgba(120, 170, 220, 0.045);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  background-image:
    linear-gradient(135deg, transparent 4.9px, var(--borde) 4.9px, var(--borde) 6.3px, transparent 6.3px),
    linear-gradient(315deg, transparent 4.9px, var(--borde) 4.9px, var(--borde) 6.3px, transparent 6.3px);
  transition: background-color 0.15s, border-color 0.15s;
}
.topo b { font-family: var(--f-display); font-size: 10px; letter-spacing: 0.12em; font-weight: 500; }
.topo:disabled { opacity: 0.45; }
.topo.sel { --borde: rgba(var(--cian-rgb), 0.7); background-color: rgba(var(--cian-rgb), 0.12); }
.topo.sel b { color: var(--cian); }
.topo.confirmar { --borde: rgba(var(--ambar-rgb), 0.8); background-color: rgba(var(--ambar-rgb), 0.14); animation: blip 0.8s ease-in-out infinite; }
.topo.confirmar b { color: var(--ambar); }
.topo-svg { width: 100%; max-width: 104px; height: auto; }
.topo-svg rect, .topo-svg path { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.topo-svg .off rect, .topo-svg .off path { stroke: rgba(120, 150, 180, 0.35); stroke-dasharray: 3 3; }
.topo-svg .on rect { stroke: rgba(var(--cian-rgb), 0.85); fill: rgba(var(--cian-rgb), 0.16); }
.topo-svg .on path { stroke: rgba(var(--cian-rgb), 0.85); }

.monitores { display: flex; flex-direction: column; gap: 8px; }
.mon { padding: 12px 14px 14px; border: 1px solid var(--linea); background: linear-gradient(90deg, rgba(var(--cian-rgb), 0.05), transparent); }
.mon.apagado { opacity: 0.45; }
.mon-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mon-cab .ico { width: 24px; height: 24px; color: var(--cian); }
.mon-cab b { display: block; font-family: var(--f-display); font-size: 11.5px; letter-spacing: 0.1em; font-weight: 500; }
.mon-cab small { display: block; font-size: 13.5px; color: var(--tenue); }
.mon-valor { margin-left: auto; font-family: var(--f-display); font-size: 22px; color: #eafcff; text-shadow: 0 0 12px rgba(var(--cian-rgb), 0.45); }
.mon input[type='range'] { --v: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; touch-action: pan-y; }
.mon input[type='range']::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, #149fbd, var(--cian) var(--v), rgba(120, 170, 220, 0.14) var(--v)); }
.mon input[type='range']::-moz-range-track { height: 6px; background: linear-gradient(90deg, #149fbd, var(--cian) var(--v), rgba(120, 170, 220, 0.14) var(--v)); }
.mon input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #eafcff; box-shadow: 0 0 12px var(--cian); }
.mon input[type='range']::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #eafcff; box-shadow: 0 0 12px var(--cian); }
.mon input[type='range']:disabled::-webkit-slider-runnable-track { background: rgba(120, 170, 220, 0.12); }
.mon input[type='range']:disabled::-webkit-slider-thumb { background: var(--apagado); box-shadow: none; }

/* ─── registro ─── */
.registro { list-style: none; margin: 0; padding: 0; font-family: var(--f-mono); font-size: 11.5px; max-height: 260px; overflow-y: auto; }
.registro li { display: grid; grid-template-columns: 44px 7px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 0; color: #a3b3c4; }
.registro li:first-child span { color: #eef6ff; }
.registro time { color: #627a92; }
.registro i { width: 6px; height: 6px; background: rgb(var(--acero-rgb)); }
.registro .ok i { background: var(--cian); box-shadow: 0 0 6px var(--cian); }
.registro .warn i { background: var(--ambar); box-shadow: 0 0 6px var(--ambar); }
.registro .danger i, .registro .error i { background: var(--rojo); box-shadow: 0 0 6px var(--rojo); }

.desconocidos { margin: 0 0 14px; font-size: 14px; color: var(--tenue); text-align: center; }

/* ─── PC desconectada ─── */
.cortina {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  margin: -4px 0 14px; padding: 16px; border: 1px dashed rgba(var(--rojo-rgb), 0.45); background: rgba(var(--rojo-rgb), 0.06);
}
.cortina .ico { width: 28px; height: 28px; color: var(--rojo); }
.cortina b { font-family: var(--f-display); font-size: 12px; letter-spacing: 0.2em; color: #ffc2cd; }
.cortina p { margin: 0; font-size: 14.5px; color: var(--tenue); }
body.pc-off .modulos .controles { opacity: 0.35; pointer-events: none; filter: saturate(0.3); }
body.pc-off .cortina { order: -1; }

.pie { margin-top: 6px; text-align: center; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--apagado); }

/* ─── toast ─── */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50;
  width: calc(100% - 32px); max-width: 480px; padding: 13px 16px;
  border-left: 3px solid var(--cian); background: rgba(8, 15, 26, 0.97); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--linea-f);
  font-size: 15.5px; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity 0.25s, transform 0.25s;
}
.toast.ver { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--rojo); }
.toast.ok { border-left-color: var(--cian); }

/* Teléfonos angostos (≤ 359 px): las filas de 6 botones pasan a 2 × 3 para que cada uno siga siendo tocable. */
@media (max-width: 359px) {
  .iconos, .chips-6 { grid-template-columns: repeat(3, 1fr); }
  .tele span { letter-spacing: 0.08em; }
  .p-cab h3 { letter-spacing: 0.16em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
