html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #050812;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 3 L11 11 L8 11 L12 21 L13 21 L9 11 L12 11 Z" fill="white" stroke="black" stroke-width="1.5"/></svg>') 3 3, auto;
}

/* White cursor for all elements */
*, *::before, *::after {
  cursor: inherit;
}

/* Loading Splash Screen */
.loading-splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #050812;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: splash-fade-in 0.8s ease-out;
}

@keyframes splash-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-logo {
  width: 240px;
  height: 240px;
  filter: drop-shadow(0 0 20px rgba(0, 234, 255, 0.3));
}

.splash-title {
  font-size: 42px;
  font-weight: 800;
  color: #00eaff;
  letter-spacing: 4px;
  margin: 0;
  text-shadow: 0 0 20px rgba(0, 234, 255, 0.5);
  animation: splash-glow 2s ease-in-out infinite alternate;
}

.splash-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: #aaa;
  letter-spacing: 2px;
  margin: 0;
  margin-top: -12px;
}

@keyframes splash-glow {
  from {
    text-shadow: 0 0 20px rgba(0, 234, 255, 0.5);
  }
  to {
    text-shadow: 0 0 30px rgba(0, 234, 255, 0.8);
  }
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.spinner-dot {
  width: 12px;
  height: 12px;
  background: #00eaff;
  border-radius: 50%;
  animation: spinner-bounce 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.6);
}

.spinner-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes spinner-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}


#map {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: #020818;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 3 L11 11 L8 11 L12 21 L13 21 L9 11 L12 11 Z" fill="white" stroke="black" stroke-width="1.5"/></svg>') 3 3, auto;
}

.logo-header {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2001;
  background: none;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Global Reset Vessels button - on map overlay next to logo */
.global-reset-btn {
  position: fixed;
  top: 92px;
  right: 24px;
  z-index: 2001;
  background: rgba(255, 107, 107, 0.2);
  border: 2px solid rgba(255, 107, 107, 0.6);
  color: #ff6b6b;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
  backdrop-filter: blur(8px);
}

.global-reset-btn:hover {
  background: rgba(255, 107, 107, 0.35);
  border-color: #ff6b6b;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
}

.global-reset-btn:active {
  transform: scale(0.98);
}

/* Top-right control stack (language + view switchers) */
.top-right-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  z-index: 2001;
  pointer-events: auto;
}

.language-switcher,
.view-switcher {
  display: inline-flex;
  gap: 3px;
  padding: 2px 3px;
  border-radius: 999px;
  border: 2px solid rgba(0, 234, 255, 0.4);
  background: rgba(5, 8, 18, 0.85);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.language-switcher-btn,
.view-switcher-btn {
  background: transparent;
  border: none;
  color: #cfefff;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.language-switcher-btn {
  font-size: 0;
  letter-spacing: 0;
  padding: 4px 8px;
  gap: 0;
  min-width: 36px;
  justify-content: center;
}

.view-switcher-btn {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  gap: 6px;
  min-width: 36px;
  justify-content: center;
}

.language-switcher-btn:hover,
.view-switcher-btn:hover {
  background: rgba(0, 234, 255, 0.15);
}

.language-switcher-btn.active,
.view-switcher-btn.active {
  background: #00eaff;
  color: #041020;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.language-switcher-btn:focus-visible,
.view-switcher-btn:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: 2px;
}


.flag-icon {
  font-size: 14px;
  line-height: 1;
}

/* When reset button is visible, nudge switcher stack left */
.global-reset-btn:not([style*="display: none"]) ~ .top-right-controls {
  right: 140px;
}


.logo-icon {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #00eaff;
  opacity: 0.85;
  margin: 0;
  text-shadow: 0 0 12px rgba(0, 234, 255, 0.8);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.logo-subtitle {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #00eaff;
  opacity: 0.77;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.version {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.5px;
  color: #00eaff;
  opacity: 0.5;
  margin: 2px 0 0 0;
  font-family: 'Courier New', monospace;
}

#radar-sweep {
  animation: radar-spin 4s linear infinite;
  transform-origin: 90px 90px;
  will-change: transform; /* Optimize for mobile - prevents repaints */
  backface-visibility: hidden; /* Reduces jitter on mobile */
  -webkit-backface-visibility: hidden; /* Safari/iOS support */
}

@keyframes radar-spin {
  from {
    transform: rotate(0deg) translateZ(0); /* Force GPU acceleration */
  }
  to {
    transform: rotate(360deg) translateZ(0);
  }
}

/* Mobile: Center splash screen content on narrow screens */
@media (max-width: 600px) {
  .splash-content {
    padding: 0 20px;
    text-align: center;
  }
  
  .splash-logo {
    width: 160px;
    height: 160px;
  }
  
  .splash-title {
    font-size: 28px;
    letter-spacing: 2px;
    text-align: center;
  }
  
  .splash-subtitle {
    font-size: 14px;
    letter-spacing: 1px;
    text-align: center;
  }
}

.vessel-svg-icon {
  background: none !important;
  border: none !important;
  cursor: pointer;
  z-index: 10;
}

.vessel-svg-icon svg {
  pointer-events: none;  /* SVG ei ota hover-eventtejä, vain parent div */
}

.attribution {
  position: fixed;
  bottom: 4px;
  left: 4px;
  background: rgba(5, 8, 18, 0.95);  /* Sama pohja kuin muut paneelit */
  padding: 5px 10px;
  font-size: 12px;
  color: #bbb;
  opacity: 0.93;
  border-radius: 5px;
  z-index: 2000;
  pointer-events: auto;
  font-weight: 400;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.attribution a {
  color: #00eaff;  /* Cyan väri kaikille attribution-linkeille */
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

/* Panel labels (shown when collapsed) */
.panel-label {
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: none; /* Hidden by default, shown when collapsed */
}

.license-link {
  color: #00eaff;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.license-link:hover {
  text-decoration: underline;
}

.license-modal {
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.license-modal-content {
  background: rgba(5, 8, 18, 0.98);
  padding: 24px 30px;
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  color: #eee;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
}

.license-modal-content h3 {
  margin: 0 0 16px 0;
  color: #00eaff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.license-section {
  margin-bottom: 14px;
  line-height: 1.5;
  font-size: 13px;
}

.license-section strong {
  color: #00eaff;
  font-weight: 600;
}

.license-section a {
  color: #aaa;
  text-decoration: underline;
}

.license-section a:hover {
  color: #00eaff;
}

.license-close {
  position: absolute;
  right: 16px;
  top: 16px;
  color: #bbb;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.license-close:hover,
.license-close:focus {
  color: #00eaff;
}

.flag-img {
  width: 24px;
  height: 18px;
  vertical-align: middle;
  margin-left: 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #eee;
}

/* Sky overlay - gradientti kartan yläosassa (voi vaikuttaa kontrastiin) */
.sky-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 25vh;  /* Alennettu 35vh -> 25vh (10% alemmas) */
  pointer-events: none;
  z-index: 1500;
  background: linear-gradient(
    to bottom,
    rgba(5, 8, 18, 0.85),  /* Tumma yläosa - vähentää kartan kirkkautta */
    rgba(5, 8, 18, 0)       /* Läpinäkyvä alaosassa */
  );
}

/* Ground vignette - varjo kartan alaosassa (voi vaikuttaa kontrastiin) */
.ground-vignette {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 25vh;
  pointer-events: none;
  z-index: 1500;
  background: radial-gradient(
    ellipse at bottom,
    rgba(0, 0, 0, 0.6),  /* Tumma varjo alhaalla */
    transparent 60%
  );
}

/* Shared data panel layout */
.data-panel {
  position: fixed;
  top: 15vh;
  bottom: 5vh;
  right: 0;
  width: 360px;
  border-radius: 12px 0 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-right: none;
  background: rgba(5, 8, 18, 0.95);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.45);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  backdrop-filter: blur(6px);
}

.data-panel.collapsed {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 8px 0 0 8px;
  opacity: 0.85;
  top: auto;
  /* bottom set by panel-layout.js */
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-panel {
  background: linear-gradient(135deg, rgba(5, 8, 18, 0.98) 80%, rgba(0, 234, 255, 0.10) 100%);
  color: #eee;
  padding: 0;
  font-size: 12px;
  width: 320px;
  box-shadow: -4px 4px 24px 4px rgba(0,234,255,0.10), -2px 2px 10px rgba(0,0,0,0.4);
  border-color: rgba(0, 234, 255, 0.3);
  transition: all 0.3s cubic-bezier(.4,1.4,.6,1);
}

.stats-header {
  padding: 10px 14px;
  background: rgba(0, 234, 255, 0.1);
  border-bottom: 1px solid rgba(0, 234, 255, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #00eaff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}

.stats-header:hover {
  background: rgba(0, 234, 255, 0.15);
}

.stats-header:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: -2px;
}

.panel-icon {
  stroke: #00eaff;
  fill: #00eaff;
  opacity: 0.85;
  flex-shrink: 0;
  background: rgba(5, 8, 18, 0.98);  /* Peittää scrollbar-nuolet ikonin alta */
  border-radius: 4px;
  padding: 2px;
}

/* Text-based panel icon for compact collapsed headers */
.panel-icon-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-weight: 700;
  color: #ff4444;
  font-size: clamp(10px, 2.4vw, 12px);
  line-height: 1;
  text-align: center;
  padding: 2px;
  border-radius: 4px;
  background: rgba(5,8,18,0.98);
  box-sizing: border-box;
}

/* Show text-icon only in collapsed state to avoid duplicating the full title */
.shadow-fleet-panel:not(.collapsed) .panel-icon-text { display: none; }
.shadow-fleet-panel.collapsed .panel-icon-text { display: inline-flex; }

/* Panel close button */
.panel-close-btn {
  background: none;
  border: none;
  color: #00eaff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 8px;
  opacity: 0.7;
  transition: all 0.2s ease;
  border-radius: 4px;
  flex-shrink: 0;
}

.panel-close-btn:hover {
  opacity: 1;
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  transform: scale(1.1);
}

.panel-close-btn:active {
  transform: scale(0.95);
}

.stats-header-title {
  flex: 1;
}

#stats-panel-arrow {
  transition: transform 0.2s;
  user-select: none;
}

.stats-panel:not(.collapsed) #stats-panel-arrow {
  transform: rotate(180deg);
}

/* Hide close button when panel is collapsed */
.stats-panel.collapsed .panel-close-btn,
.about-panel.collapsed .panel-close-btn,
.heatmap-panel.collapsed .panel-close-btn,
.territorial-report-panel.collapsed .panel-close-btn,
.featured-panel.collapsed .panel-close-btn,
.shadow-fleet-panel.collapsed .panel-close-btn {
  display: none;
}

#stats-content {
  overflow-y: auto;
  flex: 1;  /* Take remaining space in panel */
  padding: 10px 14px 24px 14px;  /* Extra bottom padding so items are visible */
}

#stats-content::-webkit-scrollbar {
  width: 6px;
}

#stats-content::-webkit-scrollbar-track {
  background: transparent;
}

#stats-content::-webkit-scrollbar-thumb {
  background: rgba(0, 234, 255, 0.2);
  border-radius: 3px;
}

#stats-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 234, 255, 0.4);
}

.stats-summary {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
  font-size: 13px;
}

.stats-summary strong {
  font-weight: 600;
  color: #00eaff;
}

.stats-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
}

.stats-tab {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(0, 234, 255, 0.05);
  color: #888;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stats-tab:hover {
  background: rgba(0, 234, 255, 0.1);
  color: #00eaff;
}

.stats-tab.active {
  background: rgba(0, 234, 255, 0.15);
  color: #00eaff;
  border-bottom-color: #00eaff;
}

.stats-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.stats-scrollable {
  flex: 1;
  overflow-y: auto;
  font-size: 12px;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.stats-scrollable::-webkit-scrollbar {
  width: 6px;
}

.stats-scrollable::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.stats-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0, 234, 255, 0.2);
  border-radius: 3px;
}

.stats-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 234, 255, 0.4);
}

.stats-dest-item {
  padding: 4px 0;
  line-height: 1.4;
  border-bottom: 1px solid rgba(0, 234, 255, 0.1);
}

.stats-dest-item:last-child {
  border-bottom: none;
}

.stats-count {
  color: #00eaff;
  font-weight: 600;
}

.stats-empty {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 10px;
}

.stats-filter-label {
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 98%;
}

.stats-filter-label input {
  margin-right: 4px;
  vertical-align: middle;
}

.stats-panel.collapsed #stats-content {
  display: none;
}

.stats-panel.collapsed {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 8px 0 0 8px;
  top: auto;
  /* bottom set by panel-layout.js */
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-panel.collapsed:hover {
  opacity: 1;
}

.stats-panel.collapsed .stats-header {
  writing-mode: horizontal-tb;
  transform: none;
  margin-bottom: 0;
  padding: 15px;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.stats-panel.collapsed #stats-content {
  display: none;
}

.stats-panel.collapsed .stats-header-title {
  display: none;
}

.stats-panel.collapsed .panel-label {
  display: block; /* Show label when collapsed */
}

.stats-panel.collapsed #stats-panel-arrow {
  display: none;
}

.stats-panel #stats-panel-arrow {
  margin-left: 8px;
  font-size: 14px;
  transition: transform 0.2s;
  color: #00eaff;
  vertical-align: middle;
  user-select: none;
}

/* Shadow Fleet Panel */
.shadow-fleet-panel {
  width: 400px;
  background: rgba(5, 8, 18, 0.95);
  border: 1px solid rgba(255, 68, 68, 0.4);
  box-shadow: -4px 0 20px rgba(255, 68, 68, 0.2);
  transition: transform 0.3s ease;
}

.shadow-fleet-panel.collapsed:hover {
  opacity: 1;
}

.shadow-fleet-panel.collapsed .shadow-fleet-header {
  writing-mode: horizontal-tb;
  transform: none;
  border-bottom: none;
  padding: 15px;
  background: transparent;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.shadow-fleet-panel.collapsed .shadow-fleet-content {
  display: none;
}

.shadow-fleet-panel.collapsed .shadow-fleet-arrow {
  display: none;
}

.shadow-fleet-panel.collapsed .shadow-fleet-title {
  display: none;
}

.shadow-fleet-header {
  padding: 10px 14px;
  background: rgba(255, 68, 68, 0.15);
  border-bottom: 1px solid rgba(255, 68, 68, 0.4);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ff4444;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}

.shadow-fleet-header:hover {
  background: rgba(255, 68, 68, 0.2);
}

.shadow-fleet-header:focus-visible {
  outline: 2px solid #ff4444;
  outline-offset: -2px;
}

.shadow-fleet-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shadow-fleet-info-btn {
  background: none;
  border: none;
  color: #ff4444;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
  vertical-align: middle;
}

.shadow-fleet-info-btn:hover {
  opacity: 1;
}

.shadow-fleet-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  color: #ff4444;
  user-select: none;
}

.shadow-fleet-panel:not(.collapsed) .shadow-fleet-arrow {
  transform: rotate(180deg);
}

.shadow-fleet-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shadow-fleet-content::-webkit-scrollbar {
  width: 6px;
}

.shadow-fleet-content::-webkit-scrollbar-track {
  background: transparent;
}

.shadow-fleet-content::-webkit-scrollbar-thumb {
  background: rgba(255, 68, 68, 0.2);
  border-radius: 3px;
}

.shadow-fleet-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 68, 68, 0.4);
}

.shadow-fleet-summary {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-header {
  display: flex;
  justify-content: center;
  align-items: center;
}

.summary-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ff4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-stat-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value-large {
  font-size: 42px;
  font-weight: 700;
  color: #ff4444;
  line-height: 1;
}

.stat-label-small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sanctions breakdown styling */
.sanctions-breakdown {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.breakdown-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: 1px solid rgba(255, 68, 68, 0.2);
  gap: 6px;
}

.breakdown-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.breakdown-value {
  font-size: 13px;
  color: #ff4444;
  font-weight: 700;
}

.shadow-fleet-action-btn {
  background: rgba(255, 68, 68, 0.2);
  border: 1px solid rgba(255, 68, 68, 0.4);
  border-radius: 6px;
  color: #ff4444;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.shadow-fleet-action-btn:hover {
  background: rgba(255, 68, 68, 0.3);
  border-color: rgba(255, 68, 68, 0.6);
}

.shadow-fleet-action-btn.active {
  background: rgba(255, 68, 68, 0.4);
  border-color: #ff4444;
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.3);
}

.shadow-fleet-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.timerange-selector {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.timerange-selector:hover {
  background: rgba(255, 68, 68, 0.15);
  border-color: rgba(255, 68, 68, 0.5);
}

.timerange-selector:focus {
  border-color: #ff4444;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.3);
}

.timerange-selector option {
  background: #0a0e1a;
  color: white;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #ff4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

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

.chart-type-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  padding: 3px;
}

.chart-type-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-type-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 68, 68, 0.1);
}

.chart-type-tab.active {
  background: rgba(255, 68, 68, 0.3);
  color: #ffffff;
}

.timeline-chart-container {
  height: 150px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 12px;
}

.shadow-fleet-timeline-info {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 68, 68, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 0 12px rgba(255, 68, 68, 0.15);
}

.shadow-fleet-info-block {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shadow-fleet-info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
}

.shadow-fleet-info-value {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.shadow-fleet-info-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

.shadow-fleet-timeline-container {
  height: 150px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 12px;
}

.shadow-fleet-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shadow-fleet-vessels-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Removed max-height and overflow - use single scrollbar from .shadow-fleet-content */
}

.shadow-fleet-vessel-item {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.shadow-fleet-vessel-item:hover {
  background: rgba(255, 68, 68, 0.15);
  border-color: rgba(255, 68, 68, 0.4);
}

.vessel-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.vessel-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
}

.sanctions-badge {
  background: rgba(255, 68, 68, 0.8);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.4;
}

.vessel-item-details {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge {
  background: #ff4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
}

/* About Panel */
.about-panel {
  width: 340px;
  background: rgba(5, 8, 18, 0.95);
  border: 1px solid rgba(0, 234, 255, 0.3);
  box-shadow: -4px 0 20px rgba(0, 234, 255, 0.15);
  transition: transform 0.3s ease;
}

.about-panel.collapsed:hover {
  opacity: 1;
}

.about-panel.collapsed .about-header {
  writing-mode: horizontal-tb;
  transform: none;
  border-bottom: none;
  padding: 15px;
  background: transparent;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  justify-content: center;
}

.about-panel.collapsed .about-content {
  display: none;
}

.about-panel.collapsed .about-arrow {
  display: none;
}

.about-panel.collapsed .about-title {
  display: none;
}

.about-panel.collapsed .panel-label {
  display: block; /* Show label when collapsed */
}

.about-header {
  padding: 10px 14px;
  background: rgba(0, 234, 255, 0.1);
  border-bottom: 1px solid rgba(0, 234, 255, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #00eaff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}

.about-header:hover {
  background: rgba(0, 234, 255, 0.15);
}

.about-header:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: -2px;
}

.about-title {
  flex: 1;
}

.about-arrow {
  transition: transform 0.2s;
  user-select: none;
}

.about-panel:not(.collapsed) .about-arrow {
  transform: rotate(180deg);
}

.about-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.about-content h1 {
  font-size: 16px;
  color: #00eaff;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.about-content p {
  margin: 0 0 12px 0;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* Heatmap Panel */
.heatmap-panel {
  width: 340px;
  background: rgba(5, 8, 18, 0.95);
  border: 1px solid rgba(0, 234, 255, 0.3);
  box-shadow: -4px 0 20px rgba(0, 234, 255, 0.15);
  transition: transform 0.3s ease;
}

.heatmap-panel.collapsed:hover {
  opacity: 1;
}

.heatmap-panel.collapsed .heatmap-header {
  writing-mode: horizontal-tb;
  transform: none;
  border-bottom: none;
  padding: 15px;
  background: transparent;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.heatmap-panel.collapsed .heatmap-content {
  display: none;
}

.heatmap-panel.collapsed .heatmap-arrow {
  display: none;
}

.heatmap-panel.collapsed .heatmap-title {
  display: none;
}

.heatmap-header {
  padding: 10px 14px;
  background: rgba(0, 234, 255, 0.1);
  border-bottom: 1px solid rgba(0, 234, 255, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #00eaff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}

.heatmap-header:hover {
  background: rgba(0, 234, 255, 0.15);
}

.heatmap-header:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: -2px;
}

.heatmap-title {
  flex: 1;
}

.heatmap-arrow {
  transition: transform 0.2s;
  user-select: none;
}

.heatmap-panel:not(.collapsed) .heatmap-arrow {
  transform: rotate(180deg);
}

.heatmap-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.heatmap-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.heatmap-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
  background: rgba(0, 234, 255, 0.05);
  border: 1px solid rgba(0, 234, 255, 0.15);
}

.heatmap-option:hover {
  background: rgba(0, 234, 255, 0.1);
  border-color: rgba(0, 234, 255, 0.3);
}

.heatmap-label {
  user-select: none;
  color: #e0e0e0;
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

/* Modern Toggle Switch */
.toggle-option {
  position: relative;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  transition: background-color 0.3s, box-shadow 0.3s;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  top: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s, background-color 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-input:checked + .toggle-slider {
  background-color: #00eaff;
  border-color: #00eaff;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.5);
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(24px);
  background-color: white;
}

.toggle-input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(0, 234, 255, 0.3);
}

/* Heatmap intensity slider */
.heatmap-intensity-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 234, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(0, 234, 255, 0.15);
}

.heatmap-intensity-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.intensity-label-text {
  color: #aaa;
}

.intensity-value {
  color: #00eaff;
  font-weight: 500;
  font-size: 14px;
}

.heatmap-intensity-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.heatmap-intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #00eaff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.heatmap-intensity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.heatmap-intensity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #00eaff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.heatmap-intensity-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Heatmap info text */
.heatmap-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 234, 255, 0.05);
  border-radius: 4px;
  border-left: 3px solid rgba(0, 234, 255, 0.3);
}

.info-icon {
  flex-shrink: 0;
  color: #00eaff;
  margin-top: 2px;
  opacity: 0.8;
}

.info-text {
  font-size: 12px;
  color: #aaa;
  line-height: 1.4;
}


/* Vessel popup styling */
/* Ensure popups are always on top of data panels */
.maplibregl-popup {
  z-index: 3000 !important;  /* Above all data panels (which start at 2100 and increment) */
}

.maplibregl-popup-content {
  background: rgba(15, 15, 20, 0.95);
  color: #e0e0e0;
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-radius: 4px;
  padding: 0;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  max-width: 280px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.maplibregl-popup-close-button {
  color: #00eaff;
  font-size: 18px;
  padding: 4px 8px;
  opacity: 0.7;
}

.maplibregl-popup-close-button:hover {
  background: rgba(0, 234, 255, 0.1);
  opacity: 1;
}

.maplibregl-popup-tip {
  border-top-color: rgba(15, 15, 20, 0.95);
}

.vessel-popup {
  padding: 10px;
}

.popup-header {
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #00eaff;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.popup-subtitle {
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
}

.popup-section {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popup-section:last-of-type {
  border-bottom: none;
  margin-bottom: 6px;
}

.popup-scrollable {
  overflow-y: auto;
  overflow-x: hidden;
}

.popup-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.popup-status.shadow {
  background: #ff3333;
  color: #ffffff;
}

.popup-fullscreen-link {
  margin-top: 10px;
  text-align: center;
}

.popup-fullscreen-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #ffffff;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.popup-fullscreen-btn:hover {
  border-color: #00eaff;
  color: #00eaff;
}

.vessel-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 10000;
}

.vessel-fullscreen-overlay.open {
  display: flex;
}

.vessel-fullscreen-content {
  background: rgba(10, 15, 25, 0.95);
  border-radius: 12px;
  width: min(480px, 90vw);
  max-height: 90vh;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  position: relative;
  display: flex;
  flex-direction: column;
}

.vessel-fullscreen-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #ffffff;
  cursor: pointer;
}

.vessel-fullscreen-body {
  overflow-y: auto;
  padding-top: 24px;
}

.vessel-fullscreen-warning {
  background: #ff2f46;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.vessel-fullscreen-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 100%;
  overflow: hidden;
}

.popup-warning-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.popup-warning-desc {
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.9;
}

.popup-warning-meta {
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.85;
}

.popup-warning-sources {
  font-size: 12px;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid #ff6b6b;
}

.popup-warning-sources > div {
  margin: 2px 0;
}

body.vessel-fullscreen-open {
  overflow: hidden;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1px 0;
  line-height: 1.3;
}

.popup-row .label {
  color: #888;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 45px;
}

.popup-row .value {
  color: #e0e0e0;
  font-size: 14px;
  text-align: right;
  flex: 1;
  font-family: 'Courier New', monospace;
}

.popup-row-flag .value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
}

.popup-details {
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

.popup-details-toggle {
  cursor: pointer;
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
  user-select: none;
  list-style: none;
}

.popup-details-toggle::-webkit-details-marker {
  display: none;
}

.popup-details-toggle::before {
  content: "▸ ";
  color: #00eaff;
  margin-right: 4px;
}

.popup-details[open] .popup-details-toggle::before {
  content: "▾ ";
}

.popup-details-toggle:hover {
  color: #00eaff;
}

.popup-details-content {
  margin-top: 4px;
  border-top: none;
  padding-top: 0;
}

.popup-track-btn {
  width: 100%;
  padding: 8px;
  background: rgba(0, 234, 255, 0.1);
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-radius: 3px;
  color: #00eaff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.popup-track-btn:hover {
  background: rgba(0, 234, 255, 0.2);
  border-color: #00eaff;
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.3);
}

.popup-track-btn:active {
  transform: scale(0.98);
}

.track-icon {
  font-size: 14px;
  opacity: 0.8;
}

/* Historical marker */
.historical-marker {
  cursor: pointer;
}

.historical-marker:hover svg {
  filter: brightness(1.3);
}

/* Restore view hint */
#restore-hint {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: rgba(0, 234, 255, 0.95);
  color: #000;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 234, 255, 0.5);
  animation: hint-pulse 2s ease-in-out infinite;
}

#restore-hint button {
  background: none;
  border: none;
  color: #000;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

#restore-hint button:hover {
  opacity: 1;
}

@keyframes hint-pulse {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(0, 234, 255, 0.5);
  }
  50% { 
    box-shadow: 0 4px 20px rgba(0, 234, 255, 0.8);
  }
}

/* ============================================================================
   Buoy Markers
   ============================================================================ */

.buoy-marker {
  filter: drop-shadow(0 0 4px rgba(0, 234, 255, 0.6));
}

.buoy-marker:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(0, 234, 255, 0.9));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.buoy-popup {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 280px;
  padding: 10px;
}

.buoy-popup .popup-header {
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #00eaff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.buoy-popup .popup-section {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.buoy-popup .popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1px 0;
  line-height: 1.3;
}

.buoy-popup .popup-row .label {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 45px;
}

.buoy-popup .popup-row .value {
  color: #e0e0e0;
  font-size: 13px;
  text-align: right;
  flex: 1;
  font-family: 'Courier New', monospace;
}

.buoy-popup .popup-footer {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 234, 255, 0.2);
  text-align: right;
}

.buoy-popup .popup-footer small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

/* Install Button */
.install-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2002;
  width: 48px;
  height: 48px;
  background: rgba(0, 234, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid #00eaff;
  border-radius: 12px;
  color: #00eaff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 234, 255, 0.3);
}

.install-button:hover {
  background: rgba(0, 234, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 234, 255, 0.5);
}

.install-button:active {
  transform: translateY(0);
}

.install-button svg {
  width: 24px;
  height: 24px;
}

/* Install Banner */
.install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2002;
  background: rgba(5, 8, 18, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid #00eaff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 234, 255, 0.4);
  max-width: 90%;
  width: 420px;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-banner-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.install-banner-text strong {
  color: #00eaff;
  font-size: 16px;
  font-weight: 600;
}

.install-banner-text small {
  color: rgba(0, 234, 255, 0.7);
  font-size: 13px;
}

.install-banner-action {
  background: #00eaff;
  color: #050812;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.install-banner-action:hover {
  background: #00d4e6;
  transform: scale(1.05);
}

.install-banner-action:active {
  transform: scale(0.98);
}

.install-banner-close {
  background: transparent;
  border: none;
  color: rgba(0, 234, 255, 0.6);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.install-banner-close:hover {
  color: #00eaff;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .install-button {
    width: 44px;
    height: 44px;
    top: 16px;
    right: 16px;
  }
  
  .install-banner {
    bottom: 16px;
    width: calc(100% - 32px);
    padding: 14px 16px;
  }
  
  .install-banner-icon {
    font-size: 28px;
  }
  
  .install-banner-text strong {
    font-size: 15px;
  }
  
  .install-banner-text small {
    font-size: 12px;
  }
  
  .install-banner-action {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Hide install prompts when running as installed PWA */
@media (display-mode: standalone) {
  .install-button,
  .install-banner {
    display: none !important;
  }
}
/* ========================================
   Featured/News Panel
   ======================================== */

/* Alert pulse animation */
@keyframes alert-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.2);
  }
}

@keyframes alert-marker-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.featured-panel.collapsed .panel-icon {
  animation: alert-pulse 2s ease-in-out infinite;
}

/* Alert marker on map */
.alert-marker {
  width: 44px;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.alert-marker-label {
  position: absolute;
  top: 48px; /* place below the 44px marker with a 4px gap */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 69, 0, 0.9);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  animation: alert-pulse 2s ease-in-out infinite;
  cursor: pointer;
  pointer-events: auto;
}

.featured-panel {
  width: 340px;
  background: rgba(20, 5, 5, 0.95);
  border: 1px solid rgba(255, 100, 50, 0.25);
  box-shadow: -4px 0 20px rgba(255, 80, 30, 0.1);
  transition: transform 0.3s ease;
}

/* Ensure full height when expanded (override panel-layout inline bottom) */
.featured-panel:not(.collapsed) {
  top: 20vh !important;
  bottom: 5vh !important;
}

.featured-panel.collapsed:hover {
  opacity: 1;
}

.featured-panel.collapsed .featured-header {
  writing-mode: horizontal-tb;
  transform: none;
  border-bottom: none;
  padding: 15px;
  background: transparent;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.featured-panel.collapsed .featured-content {
  display: none;
}

.featured-panel.collapsed .featured-arrow {
  display: none;
}

.featured-panel.collapsed .featured-title {
  display: none;
}

.featured-header {
  padding: 10px 14px;
  background: rgba(255, 100, 30, 0.15);
  border-bottom: 1px solid rgba(255, 100, 50, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ff6b35;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}

.featured-header:hover {
  background: rgba(255, 100, 30, 0.25);
}

.featured-header .panel-icon {
  color: #ff6b35;
  filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.5));
}

.featured-title {
  flex: 1;
}

.featured-arrow {
  transition: transform 0.2s;
  user-select: none;
  display: inline-block;
  font-size: 14px;
  color: #ff6b35;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  font-weight: bold;
}

.featured-panel:not(.collapsed) .featured-arrow {
  transform: rotate(180deg);
}

.featured-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.featured-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
}

.featured-item:last-child {
  border-bottom: none;
}

.featured-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 12px;
}

.featured-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: #00eaff;
  margin: 0 0 8px 0;
}

.featured-date {
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
}

.featured-description {
  margin: 0;
  color: #e0e0e0;
}

.featured-description p {
  margin: 0 0 12px 0;
}

.featured-description p:last-child {
  margin-bottom: 12px;
}

.featured-description img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 12px 0;
}

.featured-description a {
  color: #00eaff;
  text-decoration: none;
  font-weight: 500;
}

.featured-description a:hover {
  text-decoration: underline;
}

.featured-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.featured-link {
  color: #00eaff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(0, 234, 255, 0.1);
  border-radius: 4px;
  transition: background 0.2s;
  display: inline-block;
}

.featured-link:hover {
  background: rgba(0, 234, 255, 0.2);
}

.featured-vessel-btn {
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid rgba(255, 165, 0, 0.5);
  color: #ffa500;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  width: 100%;
  margin-bottom: 6px;
}

.featured-vessel-btn:hover {
  background: rgba(255, 165, 0, 0.3);
  border-color: #ffa500;
}

.featured-location-btn {
  background: rgba(0, 234, 255, 0.2);
  border: 1px solid rgba(0, 234, 255, 0.5);
  color: #00eaff;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  width: 100%;
}

.featured-location-btn:hover {
  background: rgba(0, 234, 255, 0.3);
  border-color: #00eaff;
}

/* ========================================
   Territorial Waters Report Panel
   ======================================== */

.territorial-report-panel {
  position: fixed;
  top: 15vh;
  bottom: 5vh;
  right: 0;
  width: 340px;
  background: rgba(5, 8, 18, 0.95);
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 20px rgba(0, 234, 255, 0.15);
  z-index: 5000;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.territorial-report-panel.collapsed .territorial-report-content {
  display: none;
}

.territorial-report-panel.collapsed .territorial-chart-section,
.territorial-report-panel.collapsed .territorial-summary {
  display: none;
}

.territorial-report-panel.collapsed .territorial-report-arrow {
  display: none;
}

.territorial-report-panel.collapsed .territorial-report-title {
  display: none;
}

.territorial-report-panel.collapsed .panel-label {
  display: block; /* Show label when collapsed */
}

.territorial-report-header {
  padding: 10px 14px;
  background: rgba(0, 234, 255, 0.1);
  border-bottom: 1px solid rgba(0, 234, 255, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #00eaff;
  letter-spacing: 0.5px;
}

.territorial-report-header:hover {
  background: rgba(0, 234, 255, 0.15);
}

.territorial-report-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.territorial-report-arrow {
  transition: transform 0.3s ease;
  font-size: 10px;
}

.territorial-report-panel:not(.collapsed) .territorial-report-arrow {
  transform: rotate(180deg);
}

/* Chart Section - Always visible in panel when expanded */
.territorial-chart-section {
  display: block;
  padding: 12px 16px 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
}

.territorial-chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.chart-mode-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px;
  border-radius: 4px;
  border: 1px solid rgba(0, 234, 255, 0.2);
}

.mode-toggle-btn {
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.mode-toggle-btn:hover {
  color: #00eaff;
  background: rgba(0, 234, 255, 0.1);
}

.mode-toggle-btn.active {
  color: #00eaff;
  background: rgba(0, 234, 255, 0.2);
  box-shadow: 0 0 6px rgba(0, 234, 255, 0.3);
}

.chart-time-range {
  display: flex;
  gap: 4px;
}

.time-range-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 234, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-range-btn:hover {
  color: #00eaff;
  border-color: rgba(0, 234, 255, 0.5);
  background: rgba(0, 234, 255, 0.1);
}

.time-range-btn.active {
  color: #00eaff;
  border-color: #00eaff;
  background: rgba(0, 234, 255, 0.2);
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.3);
}

.chart-label {
  font-size: 11px;
  color: #00eaff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.chart-last-update {
  font-size: 10px;
  color: #666;
  font-style: italic;
}

/* Main Chart Container */
.territorial-chart-container {
  min-height: 180px;
  max-height: 30vh;
  position: relative;
  margin: 8px 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 8px;
}

.territorial-chart-container canvas {
  max-height: 100%;
}

/* Chart Stats Row */
.chart-stats-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 234, 255, 0.3);
  margin-top: 8px;
}

.stat-item {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}

.stat-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-item span:last-child {
  font-weight: 700;
  color: #00eaff;
  font-size: 13px;
}

/* Chart Legend */
.chart-legend {
  margin-top: 12px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.legend-title {
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legend-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.legend-toggle-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(100, 100, 100, 0.5);
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.legend-toggle-btn:not(.active) {
  opacity: 0.4;
}

.legend-toggle-btn:hover {
  border-color: rgba(0, 234, 255, 0.7);
}

/* Chart View Buttons */
.chart-view-buttons {
  display: flex;
  gap: 4px;
}

/* Chart Modal */
.chart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.chart-modal-content {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  max-height: 800px;
  background: rgba(5, 8, 18, 0.98);
  border: 2px solid rgba(0, 234, 255, 0.4);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 234, 255, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chart-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 234, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 234, 255, 0.05);
}

.chart-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #00eaff;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(0, 234, 255, 0.6);
}

.chart-modal-close {
  background: none;
  border: 2px solid rgba(0, 234, 255, 0.3);
  color: #00eaff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chart-modal-close:hover {
  background: rgba(0, 234, 255, 0.1);
  border-color: #00eaff;
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.5);
}

.chart-modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-modal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.chart-control-group {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.chart-range-buttons,
.chart-view-buttons {
  display: flex;
  gap: 8px;
}

.chart-range-btn,
.chart-view-btn {
  background: rgba(5, 8, 18, 0.8);
  border: 1.5px solid rgba(0, 234, 255, 0.3);
  color: #888;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.chart-range-btn:hover,
.chart-view-btn:hover {
  border-color: rgba(0, 234, 255, 0.5);
  color: #aaa;
}

.chart-range-btn.active,
.chart-view-btn.active {
  background: rgba(0, 234, 255, 0.15);
  border-color: #00eaff;
  color: #00eaff;
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.3);
}

.chart-stats {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: #aaa;
}

.chart-stat strong {
  color: #00eaff;
  font-size: 16px;
  margin-left: 4px;
}

.chart-modal-canvas-container {
  flex: 1;
  position: relative;
  min-height: 400px;
}

.chart-modal-legend {
  padding-top: 16px;
  border-top: 1px solid rgba(0, 234, 255, 0.2);
}

.legend-title {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.legend-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 234, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  color: #ccc;
}

.legend-toggle:hover {
  border-color: rgba(0, 234, 255, 0.4);
  background: rgba(0, 0, 0, 0.5);
}

.legend-toggle.active {
  border-color: rgba(0, 234, 255, 0.6);
  background: rgba(0, 234, 255, 0.1);
  color: #fff;
}

.legend-toggle-checkbox {
  width: 14px;
  height: 14px;
  border: 2px solid #666;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}

.legend-toggle.active .legend-toggle-checkbox {
  background: #00eaff;
  border-color: #00eaff;
}

.legend-toggle.active .legend-toggle-checkbox::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 1px;
  color: #000;
  font-size: 11px;
  font-weight: bold;
}

.legend-toggle-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-toggle-count {
  color: #666;
  font-size: 11px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .chart-modal-content {
    width: 95vw;
    height: 90vh;
  }
  
  .chart-modal-header h2 {
    font-size: 16px;
  }
  
  .chart-modal-body {
    padding: 16px;
  }
  
  .chart-stats {
    gap: 12px; /* Smaller gap on mobile */
    font-size: 11px; /* Smaller text on mobile */
  }
  
  .chart-stat strong {
    font-size: 14px; /* Smaller numbers on mobile */
  }
}

/* Summary Stats */
.territorial-summary {
  padding: 10px 16px;
  background: rgba(0, 234, 255, 0.05);
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
}

.summary-stat {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 12px;
}

.summary-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 16px;
  font-weight: 600;
  color: #00eaff;
  text-shadow: 0 0 8px rgba(0, 234, 255, 0.6);
}

/* Territory Breakdown */
.summary-breakdown {
  margin-top: 8px;
}

.territory-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.territory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  font-size: 11px;
}

.territory-name {
  color: #ccc;
}

.territory-count {
  color: #00eaff;
  font-weight: 600;
  font-size: 12px;
  min-width: 30px;
  text-align: right;
}

.territorial-report-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.territorial-report-content h2 {
  font-size: 16px;
  color: #00eaff;
  margin: 0 0 8px 0;
  text-shadow: 0 0 8px rgba(0, 234, 255, 0.6);
}

.territorial-report-content h3 {
  font-size: 14px;
  color: #00eaff;
  margin: 16px 0 8px 0;
  padding: 8px 0 4px 0;
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
}

.territorial-report-content p {
  margin: 4px 0;
  color: #ccc;
}

.territorial-report-content strong {
  color: #fff;
  font-weight: 600;
}

.territorial-report-content ul {
  margin: 8px 0;
  padding-left: 20px;
  list-style: none;
}

.territorial-report-content li {
  margin: 4px 0;
  padding-left: 0;
  position: relative;
}

.territorial-report-content li::before {
  content: "•";
  color: #00eaff;
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.territorial-report-content hr {
  border: none;
  border-top: 1px solid rgba(0, 234, 255, 0.2);
  margin: 16px 0;
}

.territorial-report-content .loading,
.territorial-report-content .error {
  text-align: center;
  padding: 20px;
  color: #888;
  font-style: italic;
}

.territorial-report-content .error {
  color: #ff6b6b;
}

/* Scrollbar styling */
.territorial-report-content::-webkit-scrollbar {
  width: 6px;
}

.territorial-report-content::-webkit-scrollbar-track {
  background: transparent;
}

.territorial-report-content::-webkit-scrollbar-thumb {
  background: rgba(0, 234, 255, 0.2);
  border-radius: 3px;
}

.territorial-report-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 234, 255, 0.4);
}

/* Touch-optimized scrollbars for mobile/tablet devices */
@media (pointer: coarse) {
  /* Wider scrollbars for easier touch interaction */
  .stats-scrollable::-webkit-scrollbar,
  .territorial-report-content::-webkit-scrollbar,
  .featured-content::-webkit-scrollbar,
  .about-content::-webkit-scrollbar,
  #heatmap-content::-webkit-scrollbar,
  #report-content::-webkit-scrollbar {
    width: 12px;
  }
  
  /* More visible scrollbar thumb on touch devices - still dark */
  .stats-scrollable::-webkit-scrollbar-thumb,
  .territorial-report-content::-webkit-scrollbar-thumb,
  .featured-content::-webkit-scrollbar-thumb,
  .about-content::-webkit-scrollbar-thumb,
  #heatmap-content::-webkit-scrollbar-thumb,
  #report-content::-webkit-scrollbar-thumb {
    background: rgba(0, 234, 255, 0.3);
  }
  
  .stats-scrollable::-webkit-scrollbar-thumb:hover,
  .territorial-report-content::-webkit-scrollbar-thumb:hover,
  .featured-content::-webkit-scrollbar-thumb:hover,
  .about-content::-webkit-scrollbar-thumb:hover,
  #heatmap-content::-webkit-scrollbar-thumb:hover,
  #report-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 234, 255, 0.5);
  }
}

/* Desktop: keep thin scrollbars with dark styling */
@media (pointer: fine) {
  .stats-scrollable::-webkit-scrollbar,
  .territorial-report-content::-webkit-scrollbar,
  .featured-content::-webkit-scrollbar,
  .about-content::-webkit-scrollbar,
  #heatmap-content::-webkit-scrollbar,
  #report-content::-webkit-scrollbar {
    width: 6px;
  }
}

/* Dark scrollbar styling for all panels */
.featured-content::-webkit-scrollbar,
.about-content::-webkit-scrollbar,
#heatmap-content::-webkit-scrollbar,
#report-content::-webkit-scrollbar {
  width: 6px;
}

.featured-content::-webkit-scrollbar-track,
.about-content::-webkit-scrollbar-track,
#heatmap-content::-webkit-scrollbar-track,
#report-content::-webkit-scrollbar-track {
  background: transparent;
}

.featured-content::-webkit-scrollbar-thumb,
.about-content::-webkit-scrollbar-thumb,
#heatmap-content::-webkit-scrollbar-thumb,
#report-content::-webkit-scrollbar-thumb {
  background: rgba(0, 234, 255, 0.2);
  border-radius: 3px;
}

.featured-content::-webkit-scrollbar-thumb:hover,
.about-content::-webkit-scrollbar-thumb:hover,
#heatmap-content::-webkit-scrollbar-thumb:hover,
#report-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 234, 255, 0.4);
}

/* Info Modal */
.info-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.info-modal.active {
  display: flex;
}

.info-modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 68, 68, 0.2);
  background: rgba(255, 68, 68, 0.1);
}

.info-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #ff4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  line-height: 1;
}

.info-modal-close:hover {
  color: #fff;
}

.info-modal-body {
  padding: 20px;
  color: #e0e0e0;
  line-height: 1.6;
}

.info-modal-body p {
  margin: 0 0 12px 0;
}

.info-modal-body p:last-child {
  margin-bottom: 0;
}

.info-modal-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.info-modal-body li {
  margin: 6px 0;
}

.info-modal-body strong {
  color: #fff;
}

/* ============================================================================
   Vessel Search Panel (data-panel style)
   ============================================================================ */

.search-panel {
  background: linear-gradient(135deg, rgba(5, 8, 18, 0.98) 80%, rgba(0, 234, 255, 0.10) 100%);
  color: #eee;
  padding: 0;
  font-size: 12px;
  width: 340px;
  box-shadow: -4px 4px 24px 4px rgba(0,234,255,0.10), -2px 2px 10px rgba(0,0,0,0.4);
  border-color: rgba(0, 234, 255, 0.3);
  transition: all 0.3s cubic-bezier(.4,1.4,.6,1);
}

.search-header {
  padding: 10px 14px;
  background: rgba(0, 234, 255, 0.1);
  border-bottom: 1px solid rgba(0, 234, 255, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #00eaff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}

.search-header:hover {
  background: rgba(0, 234, 255, 0.15);
}

.search-header:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: -2px;
}

.search-title {
  flex: 1;
}

.search-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.search-panel:not(.collapsed) .search-arrow {
  transform: rotate(180deg);
}

.search-panel.collapsed .panel-close-btn {
  display: none;
}

.search-panel.collapsed .search-content {
  display: none;
}

.search-panel.collapsed {
  width: 50px;
  height: 50px;
  overflow: hidden;
}

.search-panel.collapsed:hover {
  opacity: 1;
}

.search-panel.collapsed .search-header {
  padding: 0;
  border: none;
  background: none;
  height: 100%;
  justify-content: center;
}

.search-panel.collapsed .search-title {
  display: none;
}

.search-panel.collapsed .search-arrow {
  display: none;
}

/* Search Content */
.search-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.search-input-container {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 8px;
  transition: all 0.3s ease;
}

.search-input-container:focus-within {
  border-color: #00eaff;
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.3);
}

.search-icon {
  color: rgba(0, 234, 255, 0.6);
  flex-shrink: 0;
}

.vessel-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  padding: 4px 0;
  outline: none;
  min-width: 0;
}

.vessel-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-clear-btn,
.search-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(0, 234, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-clear-btn:hover,
.search-submit-btn:hover {
  color: #00eaff;
  background: rgba(0, 234, 255, 0.15);
}

.search-submit-btn {
  background: rgba(0, 234, 255, 0.2);
  padding: 6px;
}

.search-submit-btn:hover {
  background: rgba(0, 234, 255, 0.35);
}

/* Search Results */
.search-results {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(0, 234, 255, 0.2);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 234, 255, 0.4);
}

.search-results-header {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.search-results-count {
  font-weight: 600;
  color: #00eaff;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.search-result-item:hover {
  background: rgba(0, 234, 255, 0.1);
  border-color: rgba(0, 234, 255, 0.3);
}

.search-result-item.sanctioned {
  border-left: 3px solid #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
}

.search-result-item.sanctioned:hover {
  background: rgba(255, 107, 107, 0.15);
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.search-result-name {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}

.search-sanction-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
  border-radius: 4px;
  font-weight: 700;
}

.search-result-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.search-detail strong {
  color: rgba(0, 234, 255, 0.7);
  font-weight: 500;
}

.search-detail-small {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.search-detail-small strong {
  color: rgba(0, 234, 255, 0.5);
}

.search-loading,
.search-no-results,
.search-error {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.search-error {
  color: #ff6b6b;
}

/* ===== Vessel Info Panel (uses popup styles) ===== */
.vessel-info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000; /* Above collapsed tabs (z-index ~5000) */
  /* Same background as .vessel-fullscreen-content */
  background: rgba(10, 15, 25, 0.95);
  color: #eee;
  padding: 16px;
  width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-radius: 12px;
}

/* Hide scrollbar when not needed, style it dark when visible */
.vessel-info-panel::-webkit-scrollbar {
  width: 6px;
}

.vessel-info-panel::-webkit-scrollbar-track {
  background: transparent;
}

.vessel-info-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 234, 255, 0.3);
  border-radius: 3px;
}

.vessel-info-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 234, 255, 0.5);
}

/* Inherit popup styles for consistency */
.vessel-info-panel .popup-header {
  border-bottom: 1px solid rgba(0, 234, 255, 0.2);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.vessel-info-panel .popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #00eaff;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.vessel-info-panel .popup-subtitle {
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
}

.vessel-info-panel .popup-section {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.vessel-info-panel .popup-section:last-of-type {
  border-bottom: none;
  margin-bottom: 6px;
}

.vessel-info-panel .popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1px 0;
  line-height: 1.3;
}

.vessel-info-panel .popup-row .label {
  color: #888;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 45px;
}

.vessel-info-panel .popup-row .value {
  color: #e0e0e0;
  font-size: 14px;
  text-align: right;
  flex: 1;
  font-family: 'Courier New', monospace;
}

.vessel-info-panel .vessel-fullscreen-warning {
  background: #ff2f46;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.vessel-info-panel .popup-warning-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.vessel-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.vessel-info-close:hover {
  background: rgba(255, 107, 107, 0.4);
  border-color: #ff6b6b;
}

.vessel-info-notice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.vessel-info-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(0, 234, 255, 0.05);
  border: 1px solid rgba(0, 234, 255, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

/* Mobile responsive */
@media (max-width: 768px) {
  /* Full-screen panels on mobile for better UX */
  .stats-panel:not(.collapsed),
  .about-panel:not(.collapsed),
  .heatmap-panel:not(.collapsed),
  .territorial-report-panel:not(.collapsed),
  .featured-panel:not(.collapsed),
  .shadow-fleet-panel:not(.collapsed),
  .search-panel:not(.collapsed) {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid rgba(0, 234, 255, 0.3) !important;
  }
  
  /* Ensure collapsed panels stay small on mobile */
  .stats-panel.collapsed,
  .about-panel.collapsed,
  .heatmap-panel.collapsed,
  .territorial-report-panel.collapsed,
  .featured-panel.collapsed,
  .shadow-fleet-panel.collapsed,
  .search-panel.collapsed {
    width: 50px !important;
    height: 50px !important;
  }

  .vessel-info-panel {
    width: 95vw;
    max-height: 85vh;
  }
}