/* =====================================================================
   BATALLA POR SAN FRANCISCO · Sala de operaciones 1989
   ===================================================================== */
:root {
  --fondo: #0b0f0d;
  --panel: rgba(16, 21, 19, 0.94);
  --panel-solido: #121815;
  --panel-2: #19211d;
  --linea: #2a3530;
  --linea-2: #3a4842;
  --texto: #e7ece9;
  --texto-2: #a9b5af;
  --texto-3: #6f7d76;
  --ambar: #e0a43a;
  --ambar-2: #f3c266;
  --verde: #6fcf7f;
  --otan: #3d7fe0;
  --otan-2: #8fb6f2;
  --otan-fondo: rgba(61, 127, 224, 0.14);
  --pacto: #d63a32;
  --pacto-2: #f08b84;
  --pacto-fondo: rgba(214, 58, 50, 0.14);
  --peligro: #ff5a4f;
  --radio: 10px;
  --sombra: 0 12px 40px rgba(0, 0, 0, 0.55);
  --f-titulo: 'Oswald', 'Arial Narrow', sans-serif;
  --f-texto: 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hud-alto: 64px;
  --nav-ancho: 76px;
  --panel-ancho: 440px;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}
body.f-otan { --propio: var(--otan); --propio-2: var(--otan-2); --propio-fondo: var(--otan-fondo); }
body.f-pacto { --propio: var(--pacto); --propio-2: var(--pacto-2); --propio-fondo: var(--pacto-fondo); }
body { --propio: var(--ambar); --propio-2: var(--ambar-2); --propio-fondo: rgba(224, 164, 58, 0.12); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); font-family: var(--f-texto); font-size: 15px; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ambar-2); }
h1, h2, h3, h4 { font-family: var(--f-titulo); font-weight: 600; letter-spacing: 0.02em; margin: 0; }
.mono { font-family: var(--f-mono); }
.otan { color: var(--otan-2); }
.pacto { color: var(--pacto-2); }
.tenue { color: var(--texto-2); }
.muy-tenue { color: var(--texto-3); }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; }
#mapa { position: absolute; inset: var(--hud-alto) 0 0 var(--nav-ancho); background: #0a0e0c; }

/* ------------------------------------------------------------ HUD */
#hud {
  position: absolute; inset: 0 0 auto 0; height: var(--hud-alto); z-index: 30;
  display: flex; align-items: center; gap: 18px; padding: 0 16px 0 14px;
  background: linear-gradient(180deg, #0f1512, #0b100e); border-bottom: 1px solid var(--linea);
}
.hud-marca { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.hud-logo { width: 34px; height: 34px; color: var(--ambar); }
.hud-titulo { font-family: var(--f-titulo); font-size: 17px; text-transform: uppercase; letter-spacing: 0.08em; }
.hud-reloj { font-family: var(--f-mono); font-size: 12px; color: var(--ambar-2); }
.hud-medidores { flex: 1; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.hud-medidores::-webkit-scrollbar { display: none; }
.medidor { min-width: 128px; padding: 6px 10px; border: 1px solid var(--linea); border-radius: 8px; background: var(--panel-2); cursor: help; }
.medidor .m-et { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--texto-2); display: flex; justify-content: space-between; gap: 8px; }
.medidor .m-val { font-family: var(--f-mono); font-size: 13px; color: var(--texto); }
.medidor .barra { height: 5px; border-radius: 3px; background: #26302b; margin-top: 5px; overflow: hidden; }
.medidor .barra i { display: block; height: 100%; border-radius: 3px; }
.medidor.alerta { border-color: var(--peligro); box-shadow: 0 0 0 1px rgba(255, 90, 79, 0.25) inset; }
.defcon { display: flex; gap: 3px; margin-top: 5px; }
.defcon b { flex: 1; height: 5px; border-radius: 2px; background: #26302b; }
.defcon b.on { background: var(--peligro); }
.hud-usuario { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--linea-2); background: var(--panel-2); white-space: nowrap; }
.chip.otan { border-color: var(--otan); background: var(--otan-fondo); color: var(--otan-2); }
.chip.pacto { border-color: var(--pacto); background: var(--pacto-fondo); color: var(--pacto-2); }

/* ------------------------------------------------------------ Navegación */
#nav {
  position: absolute; top: var(--hud-alto); bottom: 0; left: 0; width: var(--nav-ancho); z-index: 25;
  display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: #0d1210; border-right: 1px solid var(--linea);
}
#nav button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border: 0; border-radius: 10px;
  background: transparent; color: var(--texto-2); cursor: pointer; font-size: 11px; letter-spacing: 0.03em;
}
#nav button svg { width: 24px; height: 24px; }
#nav button:hover { background: var(--panel-2); color: var(--texto); }
#nav button.activo { background: var(--propio-fondo); color: var(--propio-2); }
#nav .punto { position: absolute; top: 8px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--ambar); box-shadow: 0 0 8px var(--ambar); }

/* ------------------------------------------------------------ Panel */
#panel {
  position: absolute; top: calc(var(--hud-alto) + 10px); bottom: 10px; left: calc(var(--nav-ancho) + 10px); width: var(--panel-ancho); z-index: 20;
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--linea); border-radius: 14px; box-shadow: var(--sombra);
  backdrop-filter: blur(10px);
}
.panel-cabecera { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--linea); }
.panel-cabecera h2 { font-size: 20px; text-transform: uppercase; letter-spacing: 0.06em; }
.panel-cuerpo { flex: 1; overflow-y: auto; padding: 14px 16px 24px; }
.cerrar { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--texto-2); cursor: pointer; padding: 0 4px; }
.cerrar:hover { color: var(--texto); }

.pestanas { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.pestanas button { padding: 7px 11px; border-radius: 8px; border: 1px solid var(--linea); background: transparent; color: var(--texto-2); cursor: pointer; font-size: 13px; }
.pestanas button.activo { border-color: var(--propio); background: var(--propio-fondo); color: var(--texto); }

.seccion { margin: 18px 0 8px; font-family: var(--f-titulo); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ambar-2); display: flex; align-items: center; gap: 8px; }
.seccion::after { content: ''; flex: 1; height: 1px; background: var(--linea); }
.tarjeta { border: 1px solid var(--linea); border-radius: var(--radio); background: var(--panel-2); padding: 12px; margin-bottom: 10px; }
.tarjeta.resaltada { border-color: var(--ambar); }
.tarjeta.otan { border-left: 3px solid var(--otan); }
.tarjeta.pacto { border-left: 3px solid var(--pacto); }
.tarjeta h3 { font-size: 15px; margin-bottom: 4px; }
.fila { display: flex; align-items: center; gap: 10px; }
.fila.entre { justify-content: space-between; }
.rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dato { padding: 8px 10px; border-radius: 8px; background: #141a17; border: 1px solid var(--linea); }
.dato .et { font-size: 11px; color: var(--texto-3); text-transform: uppercase; letter-spacing: 0.06em; }
.dato .v { font-family: var(--f-mono); font-size: 16px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: 8px 0; border-bottom: 1px solid var(--linea); }
.vacio { padding: 18px; text-align: center; color: var(--texto-3); border: 1px dashed var(--linea-2); border-radius: var(--radio); }
.nota { font-size: 13px; color: var(--texto-2); line-height: 1.45; }
.aviso { padding: 10px 12px; border-radius: 8px; background: rgba(224, 164, 58, 0.1); border: 1px solid rgba(224, 164, 58, 0.4); font-size: 13px; line-height: 1.45; }
.aviso.peligro { background: rgba(255, 90, 79, 0.1); border-color: rgba(255, 90, 79, 0.45); }

/* Botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 9px; border: 1px solid var(--linea-2);
  background: #1d2622; color: var(--texto); cursor: pointer; font-size: 14px; font-weight: 500; transition: background 0.15s, border-color 0.15s; }
.btn:hover { background: #24302a; border-color: var(--texto-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primario { background: var(--propio); border-color: var(--propio); color: #fff; }
.btn.primario:hover { filter: brightness(1.1); }
.btn.ambar { background: var(--ambar); border-color: var(--ambar); color: #1b1305; }
.btn.peligro { border-color: var(--peligro); color: var(--peligro); background: transparent; }
.btn.peq { padding: 5px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.bloque { width: 100%; }
.botones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
label.campo { display: block; margin-bottom: 10px; font-size: 12.5px; color: var(--texto-2); }
label.campo > span { display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--linea-2); background: #0f1412; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--propio); outline-offset: -1px; }
textarea { min-height: 90px; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--propio); }
.opciones-radio { display: grid; gap: 6px; }
.opciones-radio label { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--linea); border-radius: 8px; cursor: pointer; }
.opciones-radio label:has(input:checked) { border-color: var(--propio); background: var(--propio-fondo); }

/* Barras */
.barra-mini { height: 6px; border-radius: 3px; background: #26302b; overflow: hidden; }
.barra-mini i { display: block; height: 100%; }
.control-barrio { position: relative; height: 10px; border-radius: 5px; overflow: hidden; background: linear-gradient(90deg, var(--otan) 0 50%, var(--pacto) 50% 100%); }
.control-barrio i { position: absolute; top: -3px; width: 3px; height: 16px; background: #fff; box-shadow: 0 0 4px #000; }

/* ------------------------------------------------------------ Ficha flotante */
#ficha {
  position: absolute; right: 12px; top: calc(var(--hud-alto) + 10px); width: 360px; max-height: calc(100% - var(--hud-alto) - 80px); overflow-y: auto; z-index: 22;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 14px; box-shadow: var(--sombra); padding: 14px 16px; backdrop-filter: blur(10px);
}
#ficha .cab { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
#ficha .cab h3 { font-size: 18px; line-height: 1.15; }
#ficha .cab .sub { font-size: 12px; color: var(--texto-2); margin-top: 2px; }
#ficha .cab .cerrar { margin-left: auto; }
.simbolo-grande { width: 54px; height: 40px; flex: none; }

/* ------------------------------------------------------------ Teletipo */
#teletipo {
  position: absolute; left: calc(var(--nav-ancho) + 12px); right: 12px; bottom: 12px; z-index: 15; pointer-events: none;
  display: flex; justify-content: center;
}
#teletipo .tt { pointer-events: auto; max-width: 760px; display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 999px;
  background: rgba(12, 16, 14, 0.88); border: 1px solid var(--linea); font-size: 13px; cursor: pointer; box-shadow: var(--sombra); }
#teletipo .tt b { font-family: var(--f-mono); color: var(--ambar-2); font-weight: 500; }

/* ------------------------------------------------------------ Capas */
.capas { position: absolute; right: 12px; bottom: 60px; z-index: 16; display: flex; flex-direction: column; gap: 6px; }
.capas button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--linea); background: rgba(14, 19, 17, 0.9); color: var(--texto-2); cursor: pointer; display: grid; place-items: center; font-size: 11px; font-family: var(--f-mono); }
.capas button.on { color: var(--ambar-2); border-color: var(--ambar); }
.capas button svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------ Modo de órdenes */
#modo { position: absolute; left: 50%; top: calc(var(--hud-alto) + 14px); transform: translateX(-50%); z-index: 24; padding: 10px 16px; border-radius: 12px;
  background: rgba(20, 14, 4, 0.94); border: 1px solid var(--ambar); color: var(--ambar-2); display: flex; gap: 12px; align-items: center; box-shadow: var(--sombra); font-size: 14px; }

/* ------------------------------------------------------------ Modal */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(4, 6, 5, 0.72); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(3px); }
.modal-caja { width: min(820px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; background: var(--panel-solido); border: 1px solid var(--linea-2); border-radius: 16px; box-shadow: var(--sombra); }
.modal-caja.estrecha { width: min(520px, 100%); }
.modal-cab { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--panel-solido); border-bottom: 1px solid var(--linea); }
.modal-cab h2 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.05em; flex: 1; }
.modal-cuerpo { padding: 18px 20px 22px; }
.pasos { display: flex; gap: 6px; padding: 12px 20px 0; flex-wrap: wrap; }
.pasos span { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--linea); color: var(--texto-3); }
.pasos span.activo { border-color: var(--ambar); color: var(--ambar-2); }
.pasos span.hecho { color: var(--texto-2); }

/* ------------------------------------------------------------ Avisos */
#avisos { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { max-width: 380px; padding: 11px 14px; border-radius: 10px; background: #18201c; border: 1px solid var(--linea-2); box-shadow: var(--sombra); font-size: 14px; animation: entra 0.2s ease-out; }
.toast.error { border-color: var(--peligro); }
.toast.ok { border-color: var(--verde); }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------ Mapa: marcadores */
.unidad { width: 38px; height: 28px; cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.7)); transition: transform 0.12s; }
.unidad:hover { transform: scale(1.15); z-index: 5; }
.unidad.sel { transform: scale(1.25); filter: drop-shadow(0 0 6px #fff); }
.unidad.ordenada::after { content: ''; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--ambar); border: 1px solid #000; }
.unidad .barra-ef { position: absolute; left: 3px; right: 3px; bottom: -5px; height: 3px; background: #000; border-radius: 2px; overflow: hidden; }
.unidad .barra-ef i { display: block; height: 100%; background: var(--verde); }
.emplaz { width: 26px; height: 26px; cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.8)); }
.punto-clave { display: grid; place-items: center; width: 26px; height: 26px; cursor: pointer; }
.punto-clave svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px #000); }
.etiqueta-pc { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--f-titulo); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,0.65); color: #f1e3bd; pointer-events: none; }
.barco { width: 24px; height: 14px; cursor: pointer; filter: drop-shadow(0 1px 2px #000); }
.etiqueta-barrio { font-family: var(--f-titulo); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; color: #e9efe9; text-shadow: 0 1px 3px #000, 0 0 8px #000;
  text-align: center; pointer-events: none; line-height: 1.15; }
.etiqueta-barrio small { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0; }
.maplibregl-popup-content { background: var(--panel-solido); color: var(--texto); border: 1px solid var(--linea-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.maplibregl-popup-tip { border-top-color: var(--panel-solido) !important; border-bottom-color: var(--panel-solido) !important; }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,0.5) !important; color: #888; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #aaa; }
.maplibregl-ctrl-group { background: rgba(14, 19, 17, 0.9) !important; border: 1px solid var(--linea) !important; }
.maplibregl-ctrl-group button { filter: invert(0.85); }

/* ------------------------------------------------------------ Mesa de juego (asistente) */
.mesa { width: 100%; height: auto; display: block; background: #0f130f; border-radius: 10px; border: 1px solid var(--linea); }
.mesa .dz { font-family: var(--f-titulo); font-size: 6px; fill: #fff; text-transform: uppercase; letter-spacing: 0.06em; }
.mesa .dobj { font-family: var(--f-texto); font-size: 4.2px; fill: #f3d58e; }
.mesa .dm { font-family: var(--f-mono); font-size: 3.6px; fill: #8e988f; }

.regla { padding: 9px 11px; border-radius: 8px; background: #141a17; border: 1px solid var(--linea); margin-bottom: 6px; }
.regla b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.regla span { font-size: 13px; color: var(--texto-2); line-height: 1.4; }
.regla.capa-evento { border-left: 3px solid var(--ambar); }
.regla.capa-medidor { border-left: 3px solid var(--peligro); }
.regla.capa-terreno { border-left: 3px solid var(--verde); }
.regla.capa-mando { border-left: 3px solid var(--otan-2); }

/* Cola de barcos */
.barco-fila { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--linea); border-radius: 8px; margin-bottom: 5px; background: #141a17; cursor: grab; }
.barco-fila.elegido { border-color: var(--pacto); background: var(--pacto-fondo); }
.barco-fila.detectado .nom::after { content: ' · localizado'; color: var(--peligro); font-size: 11px; }
.carga { font-family: var(--f-mono); font-size: 11.5px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--linea-2); }

/* Parte de guerra */
.noticia { padding: 10px 0 12px; border-bottom: 1px solid var(--linea); cursor: pointer; }
.noticia:hover h4 { color: var(--ambar-2); }
.noticia .meta { font-family: var(--f-mono); font-size: 11px; color: var(--texto-3); display: flex; gap: 8px; }
.noticia h4 { font-family: var(--f-texto); font-weight: 600; font-size: 14.5px; margin: 3px 0; }
.noticia p { margin: 0; font-size: 13.5px; color: var(--texto-2); line-height: 1.45; white-space: pre-line; }
.noticia.imp3 h4 { font-family: var(--f-titulo); font-size: 17px; font-weight: 500; letter-spacing: 0.02em; }
.vis { font-size: 10px; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.vis.otan { background: var(--otan-fondo); color: var(--otan-2); }
.vis.pacto { background: var(--pacto-fondo); color: var(--pacto-2); }

/* Evento con decisión */
.evento { border: 1px solid var(--ambar); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: linear-gradient(180deg, rgba(224,164,58,0.08), transparent); }
.evento h3 { font-size: 17px; color: var(--ambar-2); margin-bottom: 6px; }
.evento .opcion { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--linea-2); background: #141a17; cursor: pointer; }
.evento .opcion.elegida { border-color: var(--propio); background: var(--propio-fondo); }
.evento .opcion small { display: block; color: var(--texto-3); margin-top: 3px; }

/* Ejército */
.au { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 11px 12px; border: 1px solid var(--linea); border-radius: 10px; background: #141a17; margin-bottom: 8px; }
.au.mermada { border-color: rgba(224,164,58,0.6); }
.au.destruida { border-color: rgba(255,90,79,0.6); opacity: 0.75; }
.au h4 { font-family: var(--f-texto); font-size: 14.5px; font-weight: 600; }
.equipos { display: flex; gap: 3px; flex-wrap: wrap; }
.equipos i { width: 11px; height: 11px; border-radius: 2px; background: var(--verde); }
.equipos i.baja { background: #3a2420; outline: 1px solid var(--peligro); }
.medalla { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; background: rgba(224,164,58,0.1); border: 1px solid rgba(224,164,58,0.4); font-size: 12px; margin: 0 4px 4px 0; }

/* Portada / acceso */
.portada { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background:
  radial-gradient(1200px 600px at 70% 20%, rgba(214,58,50,0.18), transparent 60%),
  radial-gradient(900px 500px at 15% 80%, rgba(61,127,224,0.18), transparent 60%), #070a09; }
.portada-int { max-width: 1080px; margin: 0 auto; padding: 48px 22px 60px; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: start; }
.portada h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1; text-transform: uppercase; letter-spacing: 0.03em; }
.portada h1 em { font-style: normal; color: var(--pacto-2); }
.portada .bajada { font-size: 17px; color: var(--texto-2); line-height: 1.55; margin: 18px 0 22px; max-width: 560px; }
.cifras { display: flex; gap: 22px; flex-wrap: wrap; margin: 20px 0; }
.cifras div { font-family: var(--f-mono); font-size: 12px; color: var(--texto-3); }
.cifras b { display: block; font-family: var(--f-titulo); font-size: 28px; color: var(--texto); font-weight: 500; }
.acceso { background: var(--panel-solido); border: 1px solid var(--linea-2); border-radius: 16px; padding: 22px; box-shadow: var(--sombra); }
.bandos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bando { border: 2px solid var(--linea); border-radius: 12px; padding: 14px; cursor: pointer; background: #121815; text-align: left; }
.bando.otan.sel { border-color: var(--otan); background: var(--otan-fondo); }
.bando.pacto.sel { border-color: var(--pacto); background: var(--pacto-fondo); }
.bando h3 { font-size: 18px; margin-bottom: 4px; }
.bando p { margin: 0; font-size: 12.5px; color: var(--texto-2); line-height: 1.4; }
.bando:disabled { opacity: 0.4; cursor: not-allowed; }

/* Manual */
.manual h3 { font-size: 16px; margin: 16px 0 6px; color: var(--ambar-2); }
.manual p, .manual li { font-size: 14px; line-height: 1.55; color: var(--texto-2); }
.manual ul { padding-left: 18px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th, .tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linea); }
.tabla th { color: var(--texto-3); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ------------------------------------------------------------ Móvil */
@media (max-width: 860px) {
  :root { --hud-alto: 56px; --nav-ancho: 0px; }
  .hud-marca { min-width: 0; }
  .hud-titulo { font-size: 13px; }
  .hud-medidores { gap: 6px; }
  .medidor { min-width: 98px; padding: 5px 7px; }
  .hud-usuario .chip span { display: none; }
  #nav { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: calc(62px + var(--seguro-abajo)); flex-direction: row; padding: 4px 4px var(--seguro-abajo); border-right: 0; border-top: 1px solid var(--linea); }
  #nav button { flex: 1; padding: 6px 0; font-size: 10px; }
  #mapa { inset: var(--hud-alto) 0 calc(62px + var(--seguro-abajo)) 0; }
  #panel { left: 0; right: 0; width: auto; top: auto; bottom: calc(62px + var(--seguro-abajo)); height: 72vh; border-radius: 16px 16px 0 0; }
  #ficha { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(70px + var(--seguro-abajo)); max-height: 60vh; }
  #teletipo { left: 8px; right: 8px; bottom: calc(70px + var(--seguro-abajo)); }
  .capas { bottom: calc(120px + var(--seguro-abajo)); right: 8px; }
  .portada-int { grid-template-columns: 1fr; padding-top: 28px; }
}
@media (max-width: 520px) {
  .hud-marca .hud-titulo { display: none; }
  .medidor .m-et span:last-child { display: none; }
}
