/* GPS Navigator — Touch-ready maritime UI */
/* ── AR Electronics brand tokens ───────────────────────────────────────────
   ADDITIVOS — no reemplazan la paleta operacional existente.
   Usar --brand-* solo para elementos de chrome UI (logo, topbar, pantallas
   informativas). */
:root {
  --brand-navy:          #0D1B2A;
  --brand-navy-mid:      #1A2744;
  --brand-blue-electric: #2563EB;
  --brand-blue-neon:     #4A9FE8;
  --brand-blue-glow:     #60B8FF;
  --brand-text:          #E2E8F0;
  --brand-silver:        #C8D2DC;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ══════════════════════════════════════════════════════════════════════════════
   PALETAS DE COLOR
   Todas las variables se sobreescriben por modo. Ningún elemento usa colores
   hardcodeados (excepto los overlays del mapa, que siempre van oscuros).
   color-mix() NO se usa — no existe en Chromium 87 (PyQt5 WebEngine).
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── DAY — puente cubierto / nublado / pantalla interior ─────────────────── */
:root {
  --bg:         #0a1628;
  --bg2:        #0f2040;
  --bg3:        #152848;
  --bg4:        #1a3258;
  --border:     #1e3e6a;
  --text:       #cce4ff;
  --muted:      #4878a8;
  --dim:        #243a58;
  --cyan:       #00d8f0;
  --cyan2:      #0096b4;
  --green:      #2edc78;
  --yellow:     #f8cc38;
  --red:        #f46060;
  --ok:         #2edc78;
  --warn:       #f8cc38;
  --err:        #f46060;
  /* glow para text-shadow: versión semitransparente del color primario */
  --cyan-glow:  rgba(0,216,240,0.32);
  --ok-glow:    rgba(46,220,120,0.40);
  /* overlay del mapa — siempre oscuro para máximo contraste sobre tiles */
  --overlay-bg:   rgba(10,22,40,0.92);
  --overlay-text: #a8c8e8;
  /* modo-botón activo */
  --modebtn-active-text: var(--text);
  /* badge borders */
  --badge-err-border: rgba(244,96,96,0.40);
  --badge-ok-border:  rgba(46,220,120,0.40);
  --badge-fix-border: rgba(0,216,240,0.40);
  /* layout */
  --header-h: 56px;
  --lp-w:     270px;
  --rp-w:     280px;
  --ol-filter: none;
  --radius:   6px;
  --touch:    48px;
}

/* ── DUSK — atardecer, conservar visión nocturna ─────────────────────────── */
html[data-mode="dusk"] {
  --bg:     #050910; --bg2:   #080e1c; --bg3:   #0c1424; --bg4: #101a2e;
  --border: #162030; --text:  #6080a0; --muted: #364e68; --dim: #1a2a3c;
  --cyan:   #2070a0; --cyan2: #185880;
  --green:  #186840; --yellow:#806010; --red:   #883030;
  --ok:     #186840; --warn:  #806010; --err:   #883030;
  --cyan-glow:  rgba(32,112,160,0.28);
  --ok-glow:    rgba(24,104,64,0.30);
  --overlay-bg:   rgba(5,9,16,0.94);
  --overlay-text: #506888;
  --modebtn-active-text: #9ab8d0;
  --badge-err-border: rgba(136,48,48,0.40);
  --badge-ok-border:  rgba(24,104,64,0.40);
  --badge-fix-border: rgba(32,112,160,0.40);
  --ol-filter: brightness(0.58) saturate(0.62);
}

/* ── NOCHE — visión nocturna, solo rojo tenue ────────────────────────────── */
html[data-mode="night"] {
  --bg:     #0a0000; --bg2:   #120000; --bg3:   #1a0202; --bg4: #220404;
  --border: #320808; --text:  #983020; --muted: #582010; --dim: #240808;
  --cyan:   #b83020; --cyan2: #882018;
  --green:  #802010; --yellow:#903010; --red:   #c03030;
  --ok:     #802010; --warn:  #903010; --err:   #c03030;
  --cyan-glow:  rgba(184,48,32,0.28);
  --ok-glow:    rgba(128,32,16,0.28);
  --overlay-bg:   rgba(10,0,0,0.96);
  --overlay-text: #602010;
  --modebtn-active-text: #d08070;
  --badge-err-border: rgba(192,48,48,0.40);
  --badge-ok-border:  rgba(128,32,16,0.40);
  --badge-fix-border: rgba(184,48,32,0.40);
  --ol-filter: brightness(0.26) saturate(0.12) sepia(0.95) hue-rotate(-22deg);
}

/* ── DAY+ — plena luz solar, máximo contraste ────────────────────────────── */
html[data-mode="dayplus"] {
  --bg:     #e8f2fc;   /* blanco azulado claro */
  --bg2:    #ffffff;   /* paneles blancos puros */
  --bg3:    #dae8f6;   /* inputs */
  --bg4:    #c8d8ec;   /* hover */
  --border: #5080b0;   /* azul medio — borde visible */
  --text:   #041220;   /* casi negro */
  --muted:  #2050a0;   /* azul oscuro legible */
  --dim:    #90aac8;   /* separadores */
  --cyan:   #0050a0;   /* azul profundo — readouts sobre blanco */
  --cyan2:  #003880;   /* azul más oscuro */
  --green:  #006030;   /* verde oscuro */
  --yellow: #906000;   /* ámbar oscuro */
  --red:    #c02020;   /* rojo oscuro */
  --ok:     #006030;
  --warn:   #906000;
  --err:    #c02020;
  --cyan-glow:  transparent;  /* no glow en modo claro */
  --ok-glow:    transparent;
  --overlay-bg:   rgba(4,18,32,0.90);  /* mapa toolbar — siempre oscuro */
  --overlay-text: #a0c0e0;
  /* mode-btn activo: texto claro sobre fondo oscuro (--cyan2 = #003880) */
  --modebtn-active-text: #e0eeff;
  --badge-err-border: rgba(192,32,32,0.50);
  --badge-ok-border:  rgba(0,96,48,0.50);
  --badge-fix-border: rgba(0,80,160,0.50);
  --ol-filter: brightness(1.06) saturate(1.08);
}


/* ══════════════════════════════════════════════════════════════════════════════
   RESET
   ══════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; -webkit-tap-highlight-color: transparent;
}


/* ══════════════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════════════ */
header {
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  flex-shrink: 0; overflow: hidden;
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 800; letter-spacing: 2px;
  color: var(--cyan); white-space: nowrap; flex-shrink: 0;
  text-shadow: 0 0 16px var(--cyan-glow);
}
.brand-logo { height: 26px; width: auto; display: block; filter: drop-shadow(0 0 4px rgba(0,216,240,0.35)); }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-sub  { font-size: 0.58em; font-weight: 400; letter-spacing: 2px; color: var(--text); }
.brand span { color: var(--text); font-weight: 400; letter-spacing: 1px; }

/* GPS status: dot + port label, sin borde de chip */
.hdr-gps {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.status-dot.dot-ok  {
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok-glow), 0 0 14px var(--ok-glow);
}
.status-dot.dot-err { background: var(--err); }
.hdr-port {
  font-size: 0.68rem; font-family: 'JetBrains Mono', monospace;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}

/* Fix badge — elemento independiente */
.fix-badge {
  padding: 3px 8px; border-radius: 20px; flex-shrink: 0;
  font-size: 0.62rem; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.5px;
  white-space: nowrap;
}
.fix-none  { background: rgba(220,80,80,0.16);   color: var(--err);  border: 1px solid var(--badge-err-border); }
.fix-ok    { background: rgba(46,180,100,0.16);  color: var(--ok);   border: 1px solid var(--badge-ok-border);  }
.fix-dgps  { background: rgba(0,210,140,0.18);   color: #00d28c;     border: 1px solid rgba(0,210,140,0.45);    } /* DGPS — verde esmeralda */
.fix-great { background: rgba(0,180,220,0.16);   color: var(--cyan); border: 1px solid var(--badge-fix-border); }

/* Separador vertical para header */
.hdr-sep {
  width: 1px; height: 22px; background: var(--border); flex-shrink: 0;
}

/* Botón PORT — círculo pequeño con ícono */
.port-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); border-radius: 50%;
  cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.port-btn:hover  { border-color: var(--cyan); color: var(--cyan); }
.port-btn:active { background: var(--bg4); }

/* Mode selector — segmented control */
.mode-seg {
  display: flex; flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; background: var(--bg3);
}
.mode-btn {
  height: 30px; padding: 0 10px;
  background: transparent; border: none;
  border-left: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.5px; white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.mode-btn:first-child { border-left: none; }
.mode-btn:hover  { background: var(--bg4); color: var(--text); }
.mode-btn.active { background: var(--cyan2); color: var(--modebtn-active-text); }

/* UTC clock */
.utc-clock {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.5px;
}


/* ══════════════════════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════════════════════════════════════ */
#app  { display: flex; flex-direction: column; height: 100%; }
#main { flex: 1; display: flex; overflow: hidden; min-height: 0; }


/* ── Panel izquierdo (GPS readout + tabs) ────────────────────────────────── */
#left-panel {
  width: var(--lp-w); min-width: var(--lp-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;   /* el scroll va en .lp-content */
}

/* Tabs del panel izquierdo */
.lp-tabs {
  display: flex; gap: 5px; padding: 8px 8px 0; flex-shrink: 0;
  background: var(--bg2); border-bottom: 2px solid var(--border);
}
.lp-tab {
  flex: 1; height: 44px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.4px; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  border-bottom: 2px solid transparent; position: relative; bottom: -2px;
}
.lp-tab:hover  { color: var(--text); border-color: var(--cyan); border-bottom-color: transparent; }
.lp-tab:active { color: var(--text); border-color: var(--cyan); border-bottom-color: transparent; }
.lp-tab.active {
  background: var(--bg2); border-color: var(--border);
  border-bottom-color: var(--bg2);   /* fusiona con el contenido */
  color: var(--cyan); font-weight: 800;
}

/* Contenedor de cada tab */
.lp-content {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.lp-content.hidden { display: none; }

/* Toolbar dentro de los tabs WPT / RTE */
.lp-section-tools {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.lp-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px; margin-bottom: 10px;
}
.lp-section:last-child { border-bottom: none; }
.lp-title {
  font-size: 0.6rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 7px; font-weight: 700;
}
/* Lectura grande (LAT / LON) */
.readout-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem; color: var(--cyan);
  font-weight: 600; line-height: 1.7;
  text-shadow: 0 0 10px var(--cyan-glow);
}
.lp-row   { display: flex; gap: 6px; }
.lp-field { flex: 1; min-width: 0; }
.lp-lbl   {
  font-size: 0.6rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px;
}
.lp-val   {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem; color: var(--text); font-weight: 600;
}


/* ── Mapa central ────────────────────────────────────────────────────────── */
#map-wrap { flex: 1; position: relative; min-width: 0; }
/* IMPORTANTE: NO aplicar filter directamente a #map — en Qt5 WebEngine el filter crea
   un compositing layer que desplaza las coordenadas de los eventos de puntero (bug Chromium 83).
   El modo nocturno se maneja por: opacidad del layer OSM (via GPSMap.setOsmOpacity) +
   paleta S-52 de colores (via ChartLayer.setChartMode) + color de fondo del canvas. */
#map { width: 100%; height: 100%; background: #a8c8e8; /* ocean blue — visible sin tiles OSM */ }

/* Barra de coordenadas (always dark overlay sobre el mapa) */
#map-coords {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  background: var(--overlay-bg);
  color: var(--overlay-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; padding: 3px 10px; border-radius: 10px;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(4px);
}

/* ── Map Tools panel (fondo del left panel) ──────────────────────────────── */
#lp-maptools {
  flex-shrink: 0;
  border-top: 2px solid var(--border);
  background: var(--bg2);
  padding: 8px;
}
.mt-label {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 1.5px;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 6px;
}
.mt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.mt-btn {
  height: 36px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  cursor: pointer; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.3px; transition: all 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.mt-btn:hover  { border-color: var(--cyan); color: var(--cyan); background: var(--bg4); }
.mt-btn:active { background: var(--bg4); }
.mt-btn.active {
  background: var(--cyan); color: var(--bg); border-color: var(--cyan);
}
/* Draw modes activos → amarillo */
.mt-btn.active#btn-draw-wpt,
.mt-btn.active#btn-draw-route {
  background: var(--yellow); color: #0a1628; border-color: var(--yellow);
}

/* Chart name indicator sobre el mapa (bottom-right) */
#map-chart-info {
  position: absolute; bottom: 32px; right: 8px; z-index: 10;
  background: var(--overlay-bg);
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; padding: 2px 8px; border-radius: 8px;
  pointer-events: none;
  border: 1px solid rgba(0,216,240,0.25);
  opacity: 0; transition: opacity 0.2s;
  white-space: nowrap;
}
#map-chart-info.visible { opacity: 1; }

/* Compatibilidad: .tb-btn se mantiene para no romper nada */
.tb-btn {
  height: var(--touch); min-width: var(--touch);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  cursor: pointer; font-size: 0.72rem; font-weight: 700;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; padding: 0 10px;
}
.tb-btn:hover  { border-color: var(--cyan); color: var(--cyan); }
.tb-btn.active { background: var(--cyan); color: var(--bg); border-color: var(--cyan); }


/* ── Panel derecho (satélites) ───────────────────────────────────────────── */
#right-panel {
  width: var(--rp-w); min-width: var(--rp-w);
  background: var(--bg2); border-left: 1px solid var(--border);
  padding: 10px 8px; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.rp-title {
  font-size: 0.6rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  align-self: flex-start; font-weight: 700;
}
/* ── Canvas wrappers para overlay de labels HTML ─────────────────────────── */
.canvas-wrap {
  position: relative;
  display: block;
  line-height: 0;   /* evita espacio extra bajo el canvas */
}
.canvas-labels {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
}
.canvas-labels span {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

#sky-canvas {
  border-radius: 50%; border: 1px solid var(--border);
  display: block;
}
.rp-sat-count {
  font-size: 0.68rem; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
#sat-used { color: var(--ok); font-weight: 700; }
#sat-view { color: var(--cyan); }


/* ── Sección NAV activo (GO-TO waypoint) ─────────────────────────────────── */
#nav-section .lp-val { color: var(--warn); }
.small-btn {
  height: 36px; padding: 0 14px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  transition: all 0.15s; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.small-btn:hover, .small-btn:active {
  border-color: var(--cyan); color: var(--cyan); background: var(--bg4);
}


/* ══════════════════════════════════════════════════════════════════════════════
   NMEA LOG
   ══════════════════════════════════════════════════════════════════════════════ */
.nmea-log {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  line-height: 1.6; white-space: pre-wrap; color: var(--muted);
  flex: 1; overflow-y: auto;
}


/* ══════════════════════════════════════════════════════════════════════════════
   LISTAS (Waypoints / Routes)
   ══════════════════════════════════════════════════════════════════════════════ */
.hidden      { display: none !important; }
.empty-list  { color: var(--muted); font-size: 0.75rem; padding: 16px 4px; }
.item-list   { display: flex; flex-direction: column; gap: 6px; }
.list-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  transition: border-color 0.15s;
}
.list-item:hover { border-color: var(--dim); }
.list-item.item-active { border-color: var(--warn); }
.item-name { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.item-sub  {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; color: var(--muted); margin-top: 3px;
}
.item-nav  {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; color: var(--cyan); margin-top: 3px;
}
.item-btns { display: flex; gap: 6px; margin-top: 8px; }
.icon-btn  {
  height: 34px; min-width: 34px; padding: 0 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  cursor: pointer; font-size: 0.78rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover, .icon-btn:active { border-color: var(--cyan); color: var(--cyan); }
.icon-btn.icon-del:hover, .icon-btn.icon-del:active { border-color: var(--err); color: var(--err); }


/* ══════════════════════════════════════════════════════════════════════════════
   MODALES (Waypoint / Route / PORT / ENC charts)
   ══════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; min-width: 320px; max-width: 440px; width: 95%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.65);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; height: 50px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.8rem; letter-spacing: 1px;
  color: var(--cyan); background: var(--bg3);
  border-radius: 10px 10px 0 0;
}
.modal-close {
  width: 38px; height: 38px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); transition: all 0.15s;
}
.modal-close:hover, .modal-close:active { color: var(--err); background: rgba(200,60,60,0.12); }
.modal-body { padding: 16px; }
.modal-btns { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Campos de formulario */
.form-field { margin-bottom: 12px; }
.form-lbl {
  display: block; font-size: 0.62rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 5px; font-weight: 600;
}
.form-inp, .form-sel {
  width: 100%; height: var(--touch);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 9px 10px;
  border-radius: var(--radius); font-size: 0.82rem; font-family: inherit;
  transition: border-color 0.15s;
}
.form-inp:focus, .form-sel:focus { outline: none; border-color: var(--cyan); }

/* Botones de acción */
.btn-primary {
  height: var(--touch); padding: 0 20px;
  background: var(--cyan); border: none; color: var(--bg);
  border-radius: var(--radius); cursor: pointer;
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.5px;
  transition: opacity 0.15s;
  display: inline-flex; align-items: center;
}
/* DAY+: --bg = #e8f2fc (claro) sobre --cyan = #0050a0 (oscuro) → OK */
.btn-primary:hover, .btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  height: var(--touch); padding: 0 18px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); cursor: pointer; font-size: 0.78rem;
  transition: all 0.15s;
  display: inline-flex; align-items: center;
}
.btn-secondary:hover, .btn-secondary:active { border-color: var(--cyan); color: var(--cyan); }

/* Selector de waypoints para rutas */
.wpt-selector {
  max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 4px;
}
.rte-wpt-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; cursor: pointer; border-radius: 4px; min-height: 40px;
}
.rte-wpt-row:hover, .rte-wpt-row:active { background: var(--bg4); }
.rte-wpt-sub {
  color: var(--muted); font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace; margin-left: auto;
}

/* Modal de cartas más ancho */
#modal-charts { max-width: 500px; }

/* ── ENC layers modal (AVANZADO) ─────────────────────────────────────────── */
#modal-enc-layers { max-width: 340px; }
.el-section-hdr {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--cyan); text-transform: uppercase;
  padding: 8px 4px 3px; margin-top: 4px;
  border-top: 1px solid var(--bg4);
}
.el-section-hdr:first-child { border-top: none; margin-top: 0; }
.enc-layer-group {
  display: flex; flex-direction: column; gap: 6px;
  padding: 4px 0;
}
.enc-layer-lbl {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  transition: background 0.15s;
  -webkit-user-select: none; user-select: none;
}
.enc-layer-lbl:hover { background: var(--bg4); }
.enc-layer-lbl input[type="checkbox"] {
  margin-top: 2px; accent-color: var(--cyan); flex-shrink: 0;
  width: 15px; height: 15px; cursor: pointer;
}
.enc-layer-lbl > div { display: flex; flex-direction: column; flex: 1; }
.enc-layer-lbl .el-name {
  font-size: 0.76rem; font-weight: 600; color: var(--text);
  line-height: 1.3; display: block;
}
.enc-layer-lbl .el-desc {
  font-size: 0.63rem; color: var(--muted); margin-top: 1px; line-height: 1.3; display: block;
}

/* ── Boat Center button ──────────────────────────────────────────────────── */
.mt-boat-center {
  width: 100%;
  height: 40px;
  background: var(--cyan2);
  border-color: var(--cyan);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.mt-boat-center:hover {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

/* ── Zoom controls sobre el mapa ────────────────────────────────────────── */
#map-zoom-ctrl {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
}
.map-zoom-btn {
  width: 40px;
  height: 40px;
  background: var(--overlay-bg);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--overlay-text);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.map-zoom-btn:hover  { background: rgba(0,216,240,0.28); color: #00d8f0; border-color: rgba(0,216,240,0.50); }
.map-zoom-btn:active { background: rgba(0,216,240,0.45); }

/* ── ENC detail level selector ──────────────────────────────────────────── */
.enc-level-sel {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}
.enc-lvl {
  flex: 1;
  padding: 5px 2px;
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.enc-lvl:hover  { background: var(--bg4); color: var(--text); border-color: var(--cyan2); }
.enc-lvl.active { background: var(--cyan2); color: #fff; border-color: var(--cyan); font-weight: 800; }

/* ── ENC hover tooltip ──────────────────────────────────────────────────────
   Aparece flotante sobre el mapa al pasar el ratón por una ayuda a la navegación.
   Diseño ECDIS: fondo oscuro, borde cyan, tipografía compacta.
   ──────────────────────────────────────────────────────────────────────────── */
.enc-tooltip {
  position: absolute;
  z-index: 200;
  pointer-events: none;        /* no bloquea el ratón */
  background: rgba(6, 14, 28, 0.96);
  border: 1px solid #00b8d0;
  border-radius: 4px;
  padding: 6px 10px;
  min-width: 110px;
  max-width: 230px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.80);
}
.enc-tt-type {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #00c8e8;
  margin-bottom: 2px;
}
.enc-tt-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #deeeff;
  line-height: 1.3;
}
.enc-tt-light {
  font-size: 0.66rem;
  color: #cc88ff;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}
.enc-tt-cat {
  font-size: 0.63rem;
  color: #7898b8;
  margin-top: 1px;
}

/* ── Feature info panel (panel derecho, aparece al click) ───────────────────
   ECDIS-style: fila etiqueta/valor compacta, badge de color por tipo de ayuda.
   ──────────────────────────────────────────────────────────────────────────── */
#rp-feat-info {
  margin: 8px 0 0 0;
  border-top: 1px solid var(--border);
  padding: 7px 0 0 0;
  font-size: 0.82rem;
}
.fi-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.fi-badge {
  font-size: 1.0rem;
  flex-shrink: 0;
  line-height: 1;
}
.fi-type {
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--cyan);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fi-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.0rem;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
}
.fi-close:hover { color: var(--text); }
.fi-rows { display: table; width: 100%; border-collapse: collapse; }
.fi-row  { display: table-row; }
.fi-lbl  {
  display: table-cell;
  color: var(--muted);
  padding: 2px 8px 2px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 62px;
  font-size: 0.75rem;
}
.fi-val  {
  display: table-cell;
  color: var(--text);
  vertical-align: top;
  font-size: 0.82rem;
  word-break: break-word;
}
.fi-row.fi-light .fi-val {
  color: #cc88ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
}
.fi-empty {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  padding: 2px 0;
}

/* ── MARCA modal — selector de tipo de marca ────────────────────────────────── */
.marca-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.marca-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg2);
  transition: border-color 0.15s, background 0.15s;
}
.marca-item:hover { border-color: var(--cyan); background: var(--bg3); }
.marca-item.selected { border-color: var(--cyan); background: var(--bg4); }
.marca-icon { font-size: 1.6rem; line-height: 1; }
.marca-label { font-size: 0.60rem; color: var(--muted); text-align: center; line-height: 1.2; }

/* ── Lock button ─────────────────────────────────────────────────────────── */
.icon-btn.icon-lock {
  color: var(--muted);
  font-size: 0.80rem;
}
.icon-btn.icon-lock.locked {
  color: var(--yellow);
}
.list-item.item-locked {
  opacity: 0.75;
  border-left: 2px solid var(--yellow);
}
/* ── Mark list item ──────────────────────────────────────────────────────── */
.mark-item-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
.mark-item-body { flex: 1; min-width: 0; }
