/* ── Design Tokens ─────────────────────────────────────────── */
:root { --radius: 12px; --topbar-h: 52px; }

* { box-sizing: border-box; margin: 0; padding: 0; }

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

html { height: 100%; }

body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top Bar ──────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 200;
}

.tb-left  { display: flex; align-items: center; gap: 10px; }
.tb-right { display: flex; align-items: center; }

/* ── Partner Logos (map overlay) ─────────────────────────── */
#partner-logos {
  position: absolute;
  top: calc(var(--topbar-h) + 10px);
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 150;
  pointer-events: none;
}

.partner-logo {
  height: 72px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s;
  pointer-events: all;
}

.partner-logo:hover { opacity: 1; }

.logo-icon {
  width: 20px; height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px; font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.logo-sub {
  font-size: 11px; font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  padding-left: 2px;
}

.mode-badge {
  font-size: 12px; font-weight: 600;
  letter-spacing: 2px;
  color: var(--green);
  text-transform: uppercase;
}

.utc-block { display: flex; align-items: baseline; gap: 6px; }

.utc-label {
  font-size: 9px; font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.utc-time {
  font-family: var(--mono);
  font-size: 13px; font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* ── Keycloak user block ──────────────────────────────────── */
.kc-user-block {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 18px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
}

.kc-username {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kc-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.kc-logout-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ── Ship popup camera buttons ───────────────────────────── */
.sp-cam-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
}

.sp-cam-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  background: rgba(0, 200, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sp-cam-btn:hover {
  background: rgba(0, 200, 255, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}

.sp-cam-btn.active {
  background: rgba(0, 200, 255, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Floating camera windows ─────────────────────────────── */
.cam-window {
  position: fixed;
  display: flex;
  flex-direction: column;
  width: 380px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  user-select: none;
  z-index: 500;
}

.cam-win-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 200, 255, 0.07);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.4px;
}

.cam-win-hdr:active { cursor: grabbing; }

.cam-win-hdr button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.cam-win-hdr button:hover { color: var(--red); }

.cam-mode-toggle {
  background: rgba(0, 200, 255, 0.1) !important;
  border: 1px solid rgba(0, 200, 255, 0.3) !important;
  color: var(--accent) !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s;
}

.cam-mode-toggle:hover {
  background: rgba(0, 200, 255, 0.2) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

.cam-win-body {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  flex: 1;
  min-height: 0;
}

.cam-win-body img,
.cam-win-body video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 200, 255, 0.3) 50%);
  border-bottom-right-radius: var(--radius);
  z-index: 10;
  transition: background 0.2s;
}

.cam-resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(0, 200, 255, 0.6) 50%);
}

.cam-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(0, 200, 255, 0.6);
  border-bottom: 2px solid rgba(0, 200, 255, 0.6);
}

.cam-no-signal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}

/* ── Camera YOLO Tab Bar ──────────────────────────────────── */
.yolo-tab-bar {
  display: flex;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--border);
}

.yolo-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
}

.yolo-tab:last-child { border-right: none; }

.yolo-tab:hover {
  background: rgba(0, 200, 255, 0.08);
  color: var(--text);
}

.yolo-tab.active {
  background: rgba(0, 200, 255, 0.12);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ── Map ──────────────────────────────────────────────────── */
#map {
  flex: 1;
  min-height: 0;
  position: relative;
}

/* ── Left Panel ───────────────────────────────────────────── */
#control-panel {
  position: absolute;
  top: calc(var(--topbar-h) + 12px);
  left: 12px;
  width: 196px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - var(--topbar-h) - 24px);
  overflow-y: auto;
}

.panel-section { display: flex; flex-direction: column; gap: 8px; }

.section-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.btn-group { display: flex; gap: 6px; }
.btn-group.col { flex-direction: column; }

.ctrl-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px; font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  text-align: left;
}

.ctrl-btn svg {
  width: 13px; height: 13px; flex-shrink: 0;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.ctrl-btn:hover,
.ctrl-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* Playback speed row */
.speed-row {
  display: flex; gap: 4px; justify-content: space-between;
}

.spd-btn {
  flex: 1;
  height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  display: flex; align-items: center; justify-content: center;
}

.spd-btn:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.spd-btn.pause-play { border-color: var(--green); color: var(--green); }

/* ── Compass ──────────────────────────────────────────────── */
.compass-wrap { display: flex; justify-content: center; }

.compass-wrap .compass {
  width: 152px !important;
  height: 152px !important;
  margin: 0 !important;
  background: var(--surface-solid) !important;
  border: 1px solid var(--border) !important;
  border-radius: 50% !important;
  padding: 10px !important;
  overflow: hidden !important;
}
.compass-wrap .disc {
  width: 152px !important; height: 152px !important;
  top: 10px !important; left: 10px !important;
}
.compass-wrap .arrow {
  width: 152px !important; height: 152px !important;
  top: 10px !important; left: 10px !important;
}

/* ── Ship Info Card ───────────────────────────────────────── */
#ship-info {
  position: absolute;
  bottom: 20px; right: 12px;
  width: 288px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 16px;
  z-index: 100;
}

.si-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.si-name {
  font-size: 14px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.3px;
}

.si-status {
  font-size: 10px; font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.si-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
}

.si-item { display: flex; flex-direction: column; gap: 3px; }

.si-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.si-value {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  color: var(--text);
}

/* ── ECDIS Panel ──────────────────────────────────────────── */
#ecdis-panel {
  position: absolute;
  top: calc(var(--topbar-h) + 12px);
  right: 12px;
  width: 400px; height: 380px;
  background: rgba(4, 12, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  z-index: 150;
  flex-direction: column;
  overflow: hidden;
}

.ecdis-hdr {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  flex-shrink: 0;
}

.ecdis-hdr button {
  background: transparent; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 14px; padding: 2px 6px;
  border-radius: 4px; transition: color 0.15s;
}
.ecdis-hdr button:hover { color: var(--text); }

#ecdistxt {
  flex: 1; background: transparent; border: none;
  color: var(--green);
  font-family: var(--mono); font-size: 11px; line-height: 1.7;
  padding: 12px 14px; resize: none; outline: none;
  overflow-y: auto;
}

/* ── Ship Popup ───────────────────────────────────────────── */
#ship-popup {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  background: rgba(4, 12, 26, 0.97);
  border: 1px solid var(--accent);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 300;
  box-shadow: 0 0 48px rgba(0, 200, 255, 0.18), 0 4px 32px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: popIn 0.18s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.sp-header {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: var(--accent-glow);
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.sp-icon { font-size: 28px; line-height: 1; }

.sp-title {
  font-size: 17px; font-weight: 700;
  color: var(--accent);
}

.sp-sub {
  font-size: 11px; color: var(--text-dim);
  margin-top: 2px;
}

.sp-close {
  margin-left: auto;
  background: transparent; border: none;
  color: var(--text-dim); font-size: 16px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color 0.15s;
}
.sp-close:hover { color: var(--text); }

.sp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.sp-item {
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
}
.sp-item:not(:nth-child(4n)) { border-right: 1px solid var(--border); }

.sp-item.sp-full {
  grid-column: 1 / -1;
  border-right: none;
}

.sp-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase;
}

.sp-value {
  font-family: var(--mono);
  font-size: 13px; color: var(--text);
}

.sp-value.sp-mono {
  font-size: 10px; color: var(--green);
  line-height: 1.7; word-break: break-all;
}

/* ── AIS Vessel Popup ─────────────────────────────────────── */
.ais-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  background: rgba(4, 12, 26, 0.97);
  border: 1px solid rgba(0, 180, 255, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 250;
  box-shadow: 0 0 24px rgba(0, 150, 255, 0.15), 0 4px 20px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: popIn 0.14s ease;
  pointer-events: all;
}

.ais-popup-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 140, 255, 0.08);
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.ais-popup-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.ais-popup-name {
  font-size: 14px; font-weight: 700;
  color: var(--text); line-height: 1.3;
}

.ais-popup-type {
  font-size: 10px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  margin-top: 2px;
}

.ais-popup-close {
  background: transparent; border: none;
  color: var(--text-dim); font-size: 13px;
  cursor: pointer; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s;
  flex-shrink: 0;
}
.ais-popup-close:hover { color: var(--text); }

.btn-track-mini {
  background: var(--accent);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 6px;
  color: white;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-track-mini:hover {
  background: rgba(0, 200, 255, 0.9);
  transform: translateY(-1px);
}

.btn-track-mini:active {
  transform: translateY(0);
}

.btn-track-mini.active {
  background: var(--red);
}

.ais-popup-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
}

.ais-popup-item {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.ais-popup-item:not(:nth-child(4n)) { border-right: 1px solid var(--border); }
.ais-popup-item.ais-popup-full { grid-column: 1 / -1; border-right: none; }
.ais-popup-item.ais-popup-half { grid-column: span 2; }
.ais-popup-item.ais-popup-half:nth-child(7) { border-right: 1px solid var(--border); }

.ais-popup-label {
  font-size: 8px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--text-dim);
  text-transform: uppercase;
}

.ais-popup-value {
  font-family: var(--mono); font-size: 11px; color: var(--text);
}

/* ── Sensor Legend ────────────────────────────────────────── */
#sensor-legend {
  position: absolute;
  bottom: 170px; right: 310px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 12px;
  z-index: 100;
  min-width: 130px;
}

/* ── Sensor Popup ─────────────────────────────────────────── */
.sensor-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  background: rgba(4, 12, 26, 0.97);
  border: 1px solid rgba(0, 200, 120, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 250;
  box-shadow: 0 0 24px rgba(0, 200, 120, 0.12), 0 4px 20px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: popIn 0.14s ease;
  pointer-events: all;
  display: none;
}

.sensor-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 200, 120, 0.07);
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.sensor-popup-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.sensor-popup-type {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sensor-readings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.sensor-reading-tag {
  background: rgba(0, 200, 120, 0.15);
  border: 1px solid rgba(0, 200, 120, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #a0f0d0;
}

/* ── AIS Legend ───────────────────────────────────────────── */
#ais-legend {
  position: absolute;
  bottom: 170px; right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 12px;
  z-index: 100;
  min-width: 130px;
}

.legend-title {
  font-size: 9px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text);
  padding: 2px 0;
}

.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}

.legend-line {
  width: 24px; height: 4px; border-radius: 2px;
  flex-shrink: 0;
}

/* ── Track Speed Legend ───────────────────────────────────── */
#track-legend {
  position: absolute;
  bottom: 170px; right: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 12px;
  z-index: 100;
  min-width: 200px;
}

.speed-gradient-bar {
  height: 20px;
  border-radius: 4px;
  margin: 8px 0 6px 0;
  background: linear-gradient(to right,
    rgba(120, 120, 120, 0.85) 0%,      /* 0 kn - Gray */
    rgba(0, 150, 255, 0.85) 10%,       /* 2 kn - Light blue */
    rgba(0, 255, 150, 0.85) 25%,       /* 5 kn - Green */
    rgba(255, 200, 0, 0.85) 50%,       /* 10 kn - Yellow */
    rgba(255, 120, 0, 0.85) 75%,       /* 15 kn - Orange */
    rgba(255, 50, 50, 0.85) 90%,       /* 20 kn - Red */
    rgba(200, 0, 0, 0.85) 100%         /* 30+ kn - Dark red */
  );
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.speed-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-dim);
  font-family: var(--mono);
  padding: 0 2px;
}

/* ── Tilt slider ──────────────────────────────────────────── */
.tilt-row {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 4px;
}

.tilt-header {
  display: flex; justify-content: space-between; align-items: center;
}

.tilt-value {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--accent);
}

.tilt-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.tilt-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 200, 255, 0.5);
  cursor: pointer;
  transition: transform 0.1s;
}

.tilt-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.tilt-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}

/* ── OL Overrides ─────────────────────────────────────────── */
.ol-attribution {
  background: rgba(4, 12, 24, 0.82) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
  border-radius: 8px 0 0 0 !important;
  border: none !important;
}
.ol-attribution a { color: var(--accent) !important; }

.ol-zoom {
  top: auto !important; bottom: 20px !important;
  left: auto !important; right: 312px !important;
}
.ol-zoom button {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  margin: 2px !important;
  font-size: 18px !important;
}
.ol-zoom button:hover {
  background: var(--accent-glow) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Track List ───────────────────────────────────────────── */
.track-list-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.track-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.track-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.track-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.track-name {
  flex: 1;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-remove-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  transition: all 0.2s;
}

.track-remove-btn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* ═══════════════════════════════════════════════════
   ALARMS PANEL
   ═══════════════════════════════════════════════════ */

#alarms-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 380px;
  max-height: 500px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.alarms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.alarms-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.alarms-badge {
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.alarms-controls {
  display: flex;
  gap: 6px;
}

.alarms-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.alarms-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.alarms-btn.muted {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Voice Configuration Section */
.alarms-voice-config {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.voice-config-row:last-child {
  margin-bottom: 0;
}

.voice-config-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.voice-config-label input[type="checkbox"] {
  cursor: pointer;
}

.voice-config-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-left: auto;
}

.voice-config-label-text {
  font-size: 13px;
  color: var(--text);
  min-width: 60px;
}

.voice-selector {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-selector:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.voice-selector:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.15);
}

.voice-selector option {
  background: var(--bg);
  color: var(--text);
}

.alarms-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
}

.alarms-list::-webkit-scrollbar {
  width: 6px;
}

.alarms-list::-webkit-scrollbar-track {
  background: transparent;
}

.alarms-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.alarms-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.alarms-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.alarm-item {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  animation: alarmSlideIn 0.3s ease-out;
  position: relative;
  transition: all 0.2s;
}

.alarm-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
}

.alarm-item.alarm-clickable {
  cursor: pointer;
}

.alarm-item.alarm-clickable:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.alarm-item.alarm-clickable:active {
  transform: translateX(-2px) scale(0.98);
}

@keyframes alarmSlideIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.alarm-item.warning {
  border-left-color: var(--yellow);
  background: rgba(251, 191, 36, 0.1);
}

.alarm-item.danger {
  border-left-color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.alarm-item.info {
  border-left-color: var(--blue);
  background: rgba(59, 130, 246, 0.1);
}

.alarm-item.success {
  border-left-color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.alarm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.alarm-type {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.alarm-dismiss {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: all 0.2s;
}

.alarm-dismiss:hover {
  color: var(--red);
  transform: scale(1.2);
}

.alarm-message {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  margin-bottom: 6px;
}

.alarm-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
}

.alarm-vessel {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 0 2px;
  color: var(--accent);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   ZONES LIST (Geofencing)
   ═══════════════════════════════════════════════════ */

.zones-list-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zones-clear-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  transition: all 0.2s;
}

.zones-clear-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--red);
  color: var(--red);
}

.zone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.zone-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.zone-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zone-name {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zone-remove-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border-radius: 4px;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}

.zone-remove-btn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* ═══════════════════════════════════════════════════
   ALARMS SETTINGS
   ═══════════════════════════════════════════════════ */

.alarms-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.alarm-setting {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alarm-setting label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.alarm-setting input[type="number"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-mono);
  transition: all 0.2s;
}

.alarm-setting input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.alarm-setting input[type="number"]:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════
   ALARM TYPES TOGGLES
   ═══════════════════════════════════════════════════ */

.alarm-types-settings {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.alarm-type-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  transition: background 0.2s;
}

.alarm-type-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.alarm-type-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.alarm-type-toggle label {
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.alarm-type-toggle input[type="checkbox"]:not(:checked) + label {
  opacity: 0.5;
  text-decoration: line-through;
}
