/* === map.css === */
/**
 * WMB Radar - Map Styles
 *
 * Custom styles for MapLibre GL map integration
 */

/* ============================================
   Map Container
   ============================================ */

.map-container {
  position: absolute;
  inset: 0;
  background-color: var(--bg-base);
}

.map-container .maplibregl-map {
  width: 100%;
  height: 100%;
}

/* ============================================
   Map Controls - Dark Theme Override
   ============================================ */

/* Navigation control (true-north reset) */
.maplibregl-ctrl-top-right {
  top: 4px !important;
  right: 4px !important;
}

.maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin: 0 0 6px 6px !important;
}

.maplibregl-ctrl-group {
  background: var(--bg-overlay) !important;
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle) !important;
  border-radius: 999px !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button {
  width: 36px !important;
  height: 36px !important;
  background-color: transparent !important;
  border: none !important;
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--border-subtle) !important;
}

.maplibregl-ctrl-group button:hover {
  background-color: var(--bg-hover) !important;
}

.maplibregl-ctrl-group button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

/* Control icons - invert for dark theme */
.maplibregl-ctrl button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(0.9);
}

/* Compass */
.maplibregl-ctrl-compass {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background-image: none !important;
  filter: none !important;
  opacity: 1;
}

.maplibregl-ctrl-compass .maplibregl-ctrl-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 9px;
  height: 18px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f8fafc 0 52%, #38bdf8 52% 100%);
  clip-path: polygon(50% 0, 100% 70%, 50% 100%, 0 70%);
}

.maplibregl-ctrl-compass .maplibregl-ctrl-icon::after {
  content: "N";
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  color: #f8fafc;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.maplibregl-ctrl-compass.wmb-true-north-lock--active {
  background: rgba(59, 130, 246, 0.28) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.maplibregl-ctrl-compass.wmb-true-north-lock--active .maplibregl-ctrl-icon::before {
  background: linear-gradient(180deg, #ffffff 0 52%, #60a5fa 52% 100%);
}

/* ============================================
   Attribution Control
   ============================================ */

.maplibregl-ctrl-attrib {
  background: var(--bg-overlay) !important;
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border-radius: var(--radius-sm) !important;
  padding: var(--space-1) var(--space-2) !important;
  font-size: var(--text-xs) !important;
  color: var(--text-tertiary) !important;
}

.maplibregl-ctrl-attrib a {
  color: var(--text-secondary) !important;
  text-decoration: none;
}

.maplibregl-ctrl-attrib a:hover {
  color: var(--text-primary) !important;
  text-decoration: underline;
}

.maplibregl-ctrl-attrib-button {
  background: var(--bg-overlay) !important;
  border-radius: var(--radius-sm) !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  min-height: 24px;
}

.maplibregl-ctrl-attrib.maplibregl-compact::after {
  filter: invert(1) brightness(0.7);
}

/* ============================================
   Scale Control
   ============================================ */

.maplibregl-ctrl-scale {
  background: var(--bg-overlay) !important;
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--border-default) !important;
  border-top: none !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  color: var(--text-secondary) !important;
  font-size: var(--text-xs) !important;
  font-family: var(--font-mono) !important;
  padding: var(--space-1) var(--space-2) !important;
}

/* ============================================
   Logo Control
   ============================================ */

.maplibregl-ctrl-logo {
  opacity: 0.5;
  filter: brightness(0.8);
}

.maplibregl-ctrl-logo:hover {
  opacity: 0.8;
}

/* ============================================
   Popup Styles
   ============================================ */

.maplibregl-popup {
  z-index: var(--z-popover);
}

.maplibregl-popup-content {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: var(--space-3) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  font-size: var(--text-sm) !important;
}

.maplibregl-popup-close-button {
  color: var(--text-secondary) !important;
  font-size: 18px !important;
  padding: var(--space-1) var(--space-2) !important;
  right: 0 !important;
  top: 0 !important;
}

.maplibregl-popup-close-button:hover {
  color: var(--text-primary) !important;
  background: transparent !important;
}

/* Popup tip/arrow */
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: var(--bg-surface) !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: var(--bg-surface) !important;
}

.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--bg-surface) !important;
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--bg-surface) !important;
}

/* ============================================
   Marker Styles
   ============================================ */

.maplibregl-marker {
  cursor: pointer;
}

/* Custom site marker */
.map-marker-site {
  width: 24px;
  height: 24px;
  background: var(--accent-primary);
  border: 2px solid white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-marker-site::after {
  content: "";
  width: 8px;
  height: 8px;
  background: white;
  border-radius: var(--radius-full);
}

/* Location marker */
.map-marker-location {
  width: 20px;
  height: 20px;
  background: var(--accent-success);
  border: 3px solid white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  animation: pulse 2s ease-in-out infinite;
}

/* User location marker - "You are here" indicator (clickable to view own profile) */
.user-location-marker {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-marker-pulse {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  animation: user-location-pulse 2s ease-out infinite;
}

.user-marker-dot {
  position: relative;
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: var(--z-docked);
}

@keyframes user-location-pulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Viewer / host location markers (unified) */
.viewer-location-marker {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.viewer-marker-pulse {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(245, 158, 11, 0.3);
  border-radius: 50%;
  animation: viewer-location-pulse 2s ease-out infinite;
}

.viewer-marker-dot {
  position: relative;
  width: 24px;
  height: 24px;
  background: #f59e0b;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: var(--z-docked);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-marker-initials {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  user-select: none;
}

/* Host-role modifier — green marker, same size as regular viewers */
.viewer-location-marker.host-role .viewer-marker-pulse {
  background: rgba(34, 197, 94, 0.3);
}
.viewer-location-marker.host-role .viewer-marker-dot {
  background: #22c55e;
}

@keyframes viewer-location-pulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Site range ring labels */
.map-range-label {
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-sm));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================
   Radar Layer Styles
   ============================================ */

/* Radar overlay canvas (when using canvas-based rendering) */
.radar-canvas-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-docked);
  /* Crisp pixels - no interpolation/smoothing */
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Crisp radar images for any img-based overlays */
.radar-image-overlay,
img[data-radar-layer] {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Radar loading indicator */
.radar-loading-indicator {
  position: absolute;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  z-index: var(--z-docked);
}

.radar-loading-indicator .spinner {
  width: 16px;
  height: 16px;
}

/* ============================================
   Map Error State
   ============================================ */

.map-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  color: var(--text-secondary);
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
}

.map-error-icon {
  width: 64px;
  height: 64px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.map-error-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.map-error-message {
  font-size: var(--text-sm);
  max-width: 320px;
}

/* ============================================
   Map Crosshair (center indicator)
   ============================================ */

.map-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: var(--z-docked);
}

.map-crosshair::before,
.map-crosshair::after {
  content: "";
  position: absolute;
  background: var(--accent-primary);
  opacity: 0.5;
}

.map-crosshair::before {
  width: 1px;
  height: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.map-crosshair::after {
  width: 20px;
  height: 1px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ============================================
   Map Info Overlays
   ============================================ */

/* Coordinates display */
.map-coordinates {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  z-index: var(--z-docked);
}

/* Zoom level display */
.map-zoom-level {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  z-index: var(--z-docked);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 639px) {
  .maplibregl-ctrl-group button {
    width: 40px !important;
    height: 40px !important;
  }

  .map-coordinates,
  .map-zoom-level {
    font-size: 10px;
    padding: var(--space-1);
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .maplibregl-ctrl-group,
  .maplibregl-ctrl-attrib,
  .maplibregl-ctrl-scale,
  .maplibregl-ctrl-logo {
    display: none !important;
  }
}

/* === metar.css === */
/**
 * WMB Radar - METAR Surface Observations Styles
 *
 * Station model markers, popup balloon, and control styles
 * for surface weather observations overlay.
 */

/* ==========================================================================
   METAR Station Model Markers
   ========================================================================== */

/* Force the MapLibre marker wrapper to never animate its positioning
   transform.  Without this, markers visibly lag behind the map during
   pan / zoom instead of being pinned to their geographic coordinate. */
.maplibregl-marker:has(.metar-station) {
  transition: none !important;
  will-change: transform;
}

.metar-station {
  cursor: pointer;
  /* No transition on the station element itself.
     MapLibre positions markers via CSS transform on the parent wrapper;
     any transition here would cause the marker to "float" / lag during
     pan and zoom instead of snapping to its geographic position. */
}

.metar-station:hover {
  z-index: var(--z-dropdown) !important;
}

/* Scale and glow are applied to the SVG child so they never interfere
   with the parent .maplibregl-marker positioning transform. */
.metar-station svg {
  overflow: visible;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.metar-station:hover svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(100, 200, 255, 0.6));
}

/* Station model SVG element classes */
.metar-temp {
  fill: #ff4444;
  font-weight: 700;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.metar-dewp {
  fill: #44dd44;
  font-weight: 700;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.metar-pressure {
  fill: #66ccff;
  font-weight: 700;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.metar-sky-circle {
  stroke: #fff;
  stroke-width: 2;
}

.metar-wind-barb {
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metar-wind-barb-fill {
  fill: #fff;
  stroke: none;
}

.metar-text-shadow {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 1)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
}

/* Gust annotation on wind barb */
.metar-gust {
  fill: #ff8c00;
  font-weight: 700;
  font-family: "Inter", "Segoe UI", sans-serif;
  letter-spacing: -0.5px;
}

/* ==========================================================================
   METAR Popup Balloon
   ========================================================================== */

.metar-popup {
  position: fixed;
  z-index: calc(var(--z-fullscreen) + 2);
  background: linear-gradient(135deg, #1a2a3a 0%, #0d1520 100%);
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  min-width: 300px;
  max-width: 400px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #e8f0f8;
  overflow: hidden;
  animation: metarPopupIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.metar-popup.hidden {
  display: none !important;
}

@keyframes metarPopupIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Popup Header */
.metar-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(100, 180, 255, 0.15);
}

.metar-popup-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.metar-station-id {
  font-size: 1.1rem;
  font-weight: 700;
  color: #66ccff;
  letter-spacing: 0.5px;
}

.metar-station-name {
  font-size: 0.8rem;
  color: #9ab;
}

.metar-popup-close {
  background: none;
  border: none;
  color: #9ab;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition:
    color 0.15s,
    background-color 0.15s;
  border-radius: 4px;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metar-popup-close:hover {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
}

/* Popup Time (Last Update) */
.metar-popup-time {
  padding: 5px 14px 6px;
  font-size: 0.72rem;
  color: #8a9;
  background: rgba(0, 100, 50, 0.06);
}

/* Raw METAR */
.metar-popup-raw {
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(100, 180, 255, 0.1);
}

.metar-popup-raw-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #789;
  margin-bottom: 3px;
}

.metar-popup-raw-text {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.8rem;
  color: #adf;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-wrap;
  display: block;
}

/* Popup Content */
.metar-popup-content {
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* Section Layout */
.metar-section {
  margin-bottom: 12px;
}

.metar-section:last-child {
  margin-bottom: 0;
}

.metar-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #789;
  margin-bottom: 4px;
}

.metar-section-content {
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Value Colors */
.metar-value-temp {
  color: #ff6b6b;
  font-weight: 600;
}

.metar-value-dewp {
  color: #6bff6b;
  font-weight: 600;
}

.metar-value-pressure {
  color: #66ccff;
  font-weight: 600;
}

.metar-value-wind {
  color: #ffcc66;
  font-weight: 600;
}

.metar-value-vis {
  color: #cc99ff;
  font-weight: 600;
}

/* Flight Category Badges */
.metar-flight-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.metar-flight-cat.vfr {
  background: #2d6b2d;
  color: #8f8;
}

.metar-flight-cat.mvfr {
  background: #2d4a6b;
  color: #8cf;
}

.metar-flight-cat.ifr {
  background: #6b2d2d;
  color: #f88;
}

.metar-flight-cat.lifr {
  background: #5a2d6b;
  color: #f8f;
}

/* Feels-Like Row (Wind Chill / Heat Index) */
.metar-feels-like {
  padding: 3px 0;
  margin: 1px 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Weather Items */
.metar-weather-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(100, 150, 200, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 3px 2px 0;
  font-size: 0.8rem;
}

/* Decoded Remarks */
.metar-remarks-decoded {
  margin-bottom: 6px;
}

.metar-remark-item {
  padding: 3px 0;
  font-size: 0.82rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(100, 180, 255, 0.06);
}

.metar-remark-item:last-child {
  border-bottom: none;
}

.metar-remark-label {
  color: #8ab;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metar-remark-value {
  color: #cde;
}

/* ==========================================================================
   METAR Settings Controls
   ========================================================================== */

.metar-units-control {
  margin-top: 8px;
  margin-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metar-unit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metar-unit-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 70px;
}

.metar-unit-select {
  font-size: 0.8rem;
  padding: 2px 6px;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.metar-unit-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Density slider */
.metar-density-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-elevated, #1e293b);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.metar-density-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary, #3b82f6);
  border: 2px solid var(--bg-surface, #0f172a);
  cursor: pointer;
}

.metar-density-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary, #3b82f6);
  border: 2px solid var(--bg-surface, #0f172a);
  cursor: pointer;
}

.metar-density-value {
  min-width: 18px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
}

/* ==========================================================================
   Popup Scrollbar
   ========================================================================== */

.metar-popup-content::-webkit-scrollbar {
  width: 6px;
}

.metar-popup-content::-webkit-scrollbar-track {
  background: transparent;
}

.metar-popup-content::-webkit-scrollbar-thumb {
  background-color: rgba(100, 180, 255, 0.2);
  border-radius: 3px;
}

.metar-popup-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 180, 255, 0.4);
}

/* ==========================================================================
   NWS Alert Popup (matches METAR / Location popup style)
   ========================================================================== */

.nws-alert-popup-card {
  position: fixed;
  z-index: calc(var(--z-fullscreen) + 2);
  background: linear-gradient(135deg, #1a2a3a 0%, #0d1520 100%);
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  min-width: 340px;
  max-width: 460px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #e8f0f8;
  overflow: hidden;
  animation: metarPopupIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.nws-alert-popup-card.hidden {
  display: none !important;
}

.nws-alert-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(100, 180, 255, 0.15);
}

.nws-alert-popup-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nws-alert-popup-title #nws-alert-popup-event-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nws-alert-popup-title #nws-alert-popup-effective {
  font-size: 0.8rem;
  color: rgba(232, 240, 248, 0.7);
}

.nws-alert-popup-title #nws-alert-popup-office {
  font-size: 0.75rem;
  color: rgba(232, 240, 248, 0.5);
}

.nws-alert-popup-close {
  background: none;
  border: none;
  color: #9ab;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition:
    color 0.15s,
    background-color 0.15s;
  border-radius: 4px;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nws-alert-popup-close:hover {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
}

.nws-alert-popup-content {
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.nws-alert-popup-content::-webkit-scrollbar {
  width: 6px;
}

.nws-alert-popup-content::-webkit-scrollbar-track {
  background: transparent;
}

.nws-alert-popup-content::-webkit-scrollbar-thumb {
  background-color: rgba(100, 180, 255, 0.2);
  border-radius: 3px;
}

.nws-alert-popup-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 180, 255, 0.4);
}

.nws-alert-popup-carousel {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.7rem;
  color: #789;
  margin-bottom: 8px;
}

.nws-alert-popup-nav {
  background: none;
  border: none;
  color: #9ab;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition:
    color 0.15s,
    background-color 0.15s;
  border-radius: 4px;
}

.nws-alert-popup-nav:hover {
  color: #66ccff;
  background-color: rgba(100, 180, 255, 0.1);
}

.nws-alert-popup-nav:disabled {
  color: #456;
  cursor: not-allowed;
}

.nws-alert-popup-meta {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: #9ab;
  margin-bottom: 12px;
}

.nws-alert-popup-meta div {
  display: flex;
  gap: 6px;
}

.nws-alert-popup-meta strong {
  color: #8a9;
  min-width: 5em;
}

.nws-alert-popup-section {
  margin-bottom: 12px;
}

.nws-alert-popup-section:last-child {
  margin-bottom: 0;
}

.nws-alert-popup-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #789;
  margin-bottom: 4px;
}

.nws-alert-popup-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #adf;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.nws-alert-popup-overlap {
  font-size: 0.7rem;
  color: #789;
  margin-bottom: 8px;
}

/* ==========================================================================
   Location Profile Popup (host/viewer markers)
   ========================================================================== */

/* ── Location Profile Popup Card ───────────────────────────── */
.location-profile-popup {
  position: fixed;
  z-index: calc(var(--z-fullscreen) + 2);
  background: linear-gradient(160deg, #172637 0%, #0d1520 100%);
  border: 1px solid rgba(100, 180, 255, 0.25);
  border-radius: 12px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  min-width: 300px;
  max-width: 380px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #e0eaf4;
  overflow: hidden;
  animation: metarPopupIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.location-profile-popup.hidden {
  display: none !important;
}

/* Header */
.location-profile-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(100, 180, 255, 0.12);
}

.location-profile-popup-title {
  display: flex;
  align-items: baseline;
}

.location-profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #66ccff;
  letter-spacing: 0.01em;
}

/* Header action buttons (message, video call) */
.location-profile-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
}

.location-profile-header-actions.is-hidden {
  display: none;
}

.location-profile-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: rgba(102, 204, 255, 0.1);
  border: 1px solid rgba(102, 204, 255, 0.2);
  border-radius: 50%;
  color: #66ccff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.location-profile-action-btn:hover {
  background: rgba(102, 204, 255, 0.2);
  border-color: rgba(102, 204, 255, 0.4);
  color: #99ddff;
  transform: scale(1.08);
}

.location-profile-action-btn:active {
  transform: scale(0.95);
}

.location-profile-action-btn svg {
  width: 16px;
  height: 16px;
}

.location-profile-popup-close {
  background: none;
  border: none;
  color: #8a9baa;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition:
    color 0.15s,
    background-color 0.15s;
  border-radius: 4px;
}

.location-profile-popup-close:hover {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
}

/* Content area */
.location-profile-popup-content {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Profile photo */
.location-profile-photo {
  max-width: 140px;
  max-height: 140px;
  min-width: 100px;
  min-height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(100, 180, 255, 0.15);
}

.location-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Details rows */
.location-profile-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.location-profile-row {
  font-size: 0.84rem;
  line-height: 1.45;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Bold label (Organization, Spotter ID) */
.location-profile-label {
  font-weight: 600;
  color: #8badc4;
  white-space: nowrap;
  flex-shrink: 0;
}

.location-profile-label::after {
  content: ":";
}

/* Value text */
.location-profile-value {
  color: #e0eaf4;
  font-weight: 400;
}

/* Notes row — block layout with value underneath the label */
.location-profile-notes-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(100, 180, 255, 0.1);
  flex-direction: column;
  gap: 4px;
}

.location-profile-notes-row .location-profile-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6d8a9e;
}

.location-profile-notes-row .location-profile-label::after {
  content: "";
}

.location-profile-notes-row .location-profile-value {
  font-style: italic;
  font-size: 0.84rem;
  color: #bccfde;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* === l2-panel.css === */
/**
 * WMB Radar - Level 2 Information Panel Styles
 *
 * GR2Analyst-style right-side drawer for Level 2 radar metadata.
 * Uses the design system variables from variables.css.
 */

/* =============================================================================
   Toggle Button (anchored to right edge of map)
   ============================================================================= */

.l2-panel-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-docked);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    right var(--transition-normal),
    opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.l2-panel-toggle:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.l2-panel-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* When panel is open, shift toggle left to sit flush with panel */
.l2-toggle--shifted {
  right: calc(var(--sidebar-width) + 12px);
}

/* Hidden when not Level 2 */
.l2-toggle--hidden {
  display: none !important;
}

/* =============================================================================
   Panel Container
   ============================================================================= */

.l2-info-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--bg-overlay);
  border-left: 1px solid var(--border-default);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  z-index: var(--z-docked);
  transform: translateX(100%);
  transition: transform var(--transition-normal) var(--ease-out);
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
}

.l2-info-panel.l2-panel--open {
  transform: translateX(0);
}

.l2-info-panel.l2-panel--hidden {
  display: none !important;
}

/* =============================================================================
   Panel Header
   ============================================================================= */

.l2-panel-header {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(25, 32, 100, 0.6);
}

.l2-panel-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.l2-panel-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.l2-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.l2-panel-close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.l2-panel-site {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.l2-site-code {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

/* =============================================================================
   Panel Body (scrollable)
   ============================================================================= */

.l2-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

/* =============================================================================
   Sections
   ============================================================================= */

.l2-section {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.l2-section:last-child {
  border-bottom: none;
}

.l2-section-label {
  font-size: 0.65rem;
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-1-5);
}

/* =============================================================================
   Scan Info Rows
   ============================================================================= */

.l2-scan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.l2-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 1px 0;
}

.l2-info-key {
  font-size: 0.7rem;
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  min-width: 32px;
}

.l2-info-val {
  font-size: 0.7rem;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}

.l2-info-val--mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: -0.02em;
}

/* =============================================================================
   Product Grid (GR2Analyst-style radio button grid)
   ============================================================================= */

.l2-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.l2-product-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  user-select: none;
  line-height: 1;
}

.l2-product-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.l2-product-btn--active {
  background: var(--accent-selected);
  color: white;
  border-color: var(--accent-selected);
  font-weight: var(--font-semibold);
}

.l2-product-btn--active:hover {
  background: var(--accent-selected-hover);
  color: white;
  border-color: var(--accent-selected-hover);
}

.l2-product-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

/* =============================================================================
   Tilt Grid (elevation angle buttons)
   ============================================================================= */

.l2-tilt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.l2-tilt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  user-select: none;
}

.l2-tilt-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.l2-tilt-btn--active {
  background: var(--accent-selected);
  border-color: var(--accent-selected);
}

.l2-tilt-btn--active:hover {
  background: var(--accent-selected-hover);
  border-color: var(--accent-selected-hover);
}

.l2-tilt-angle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  line-height: 1;
}

.l2-tilt-btn--active .l2-tilt-angle {
  color: white;
  font-weight: var(--font-semibold);
}

.l2-tilt-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

/* =============================================================================
   Product Details
   ============================================================================= */

.l2-product-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.l2-detail-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* =============================================================================
   Bottom Status Bar (cursor tracking, next update)
   ============================================================================= */

.l2-status-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--border-default);
  background: rgba(15, 20, 60, 0.85);
  padding: var(--space-1-5) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.l2-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: nowrap;
  overflow: hidden;
}

.l2-status-row--update {
  padding-top: 2px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 1px;
}

.l2-status-item {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.3;
}

.l2-status-item--update {
  color: var(--accent-info);
  font-weight: var(--font-medium);
}

.l2-status-sep {
  font-size: 0.55rem;
  color: var(--text-tertiary);
  opacity: 0.5;
  line-height: 1;
}

/* =============================================================================
   Responsive: Collapse on narrow viewports
   ============================================================================= */

@media (max-width: 767px) {
  .l2-info-panel {
    width: 300px;
  }

  .l2-toggle--shifted {
    right: calc(300px + 12px);
  }
}

@media (max-width: 479px) {
  .l2-info-panel {
    width: 240px;
  }

  .l2-toggle--shifted {
    right: calc(240px + 12px);
  }

  .l2-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === main.css === */
/**
 * WMB Radar - Main Stylesheet
 *
 * Core application layout and structure styles.
 * Component-specific styles are in components.css.
 * Utilities are in utilities.css.
 */

/* ============================================
   Base Styles
   ============================================ */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow: hidden;
}

/* App Container */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport for mobile */
  overflow: hidden;
}

/* ============================================
   App Header
   ============================================ */

.header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--header-height);
  padding: 0 var(--space-4);
  background-color: var(--bg-base); /* Same as body - matches PNG logo */
  border-bottom: 1px solid var(--border-subtle);
  z-index: var(--z-sticky);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-logo {
  height: 40px;
  width: auto;
  border-radius: var(--radius-sm);
}

.header-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Header Selectors (Product + Tilt custom dropdowns) */
.header-selectors {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: var(--space-8);
}

/* Wrapper for each custom dropdown */
.hdr-select {
  position: relative;
}

/* Fix button widths to the longest label so they never resize */
#product-select .hdr-select-btn {
  min-width: 260px;
}

#tilt-select .hdr-select-btn {
  min-width: 155px;
}

/* VCP display (supplemental info, right of tilt dropdown) */
.vcp-display {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Trigger button */
.hdr-select-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.hdr-select-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-default);
}

.hdr-select-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.hdr-select-btn[aria-expanded="true"] {
  border-color: var(--accent-primary);
}

.hdr-select-btn[aria-expanded="true"] .hdr-select-chevron {
  transform: rotate(180deg);
}

.hdr-select-label {
  flex: 1;
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.hdr-select-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

/* Dropdown panel */
.hdr-select-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  min-width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: slideDown var(--transition-fast) var(--ease-out);
}

/* List */
.hdr-select-list {
  list-style: none;
  margin: 0;
  padding: var(--space-1);
  max-height: 420px;
  overflow-y: auto;
}

/* Group header (category label) */
.hdr-select-group {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-docked);
}

.hdr-select-group:not(:first-child) {
  margin-top: var(--space-1);
}

/* Selectable item */
.hdr-select-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.hdr-select-item:hover {
  background-color: var(--bg-hover);
}

.hdr-select-item--active {
  background-color: var(--accent-selected-light);
}

/* Checkmark */
.hdr-select-check {
  width: 16px;
  flex-shrink: 0;
  font-size: var(--text-sm);
  color: var(--accent-primary);
  text-align: center;
}

.hdr-select-text {
  flex: 1;
  white-space: nowrap;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.header-controls .header-btn,
.header-controls .site-map-picker-btn,
.header-controls .analysis-btn,
.header-controls .inspector-btn,
.header-controls .forecast-btn {
  color: #ffffff;
}

.header-controls .header-btn:hover,
.header-controls .site-map-picker-btn:hover,
.header-controls .analysis-btn:hover,
.header-controls .inspector-btn:hover,
.header-controls .forecast-btn:hover,
.header-controls .header-btn.is-active,
.header-controls .site-map-picker-btn.is-active,
.header-controls .analysis-btn.is-active,
.header-controls .inspector-btn.is-active,
.header-controls .forecast-btn.is-active {
  color: #ffffff;
}

@media (min-width: 1025px) {
  .header-controls .site-map-picker-btn,
  .header-controls .analysis-btn,
  .header-controls .inspector-btn,
  .header-controls .forecast-btn {
    width: 44px;
    height: 44px;
  }

  .header-controls .site-map-picker-btn svg,
  .header-controls .analysis-btn svg,
  .header-controls .inspector-btn svg,
  .header-controls .forecast-btn svg {
    width: 22px;
    height: 22px;
  }
}

/* Header Status */
.header-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-site {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--text-tertiary);
  transition:
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.status-indicator--connected {
  background-color: var(--accent-success);
  box-shadow: var(--shadow-glow-success);
}

.status-indicator--loading {
  background-color: var(--accent-warning);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator--error {
  background-color: var(--accent-danger);
  box-shadow: var(--shadow-glow-danger);
}

/* ============================================
   Main Content Area
   ============================================ */

.main-content {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Map Container - Full area for radar display */
.map-container {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}

/* Content Overlay - Panels on top of map */
.content-overlay {
  position: relative;
  z-index: var(--z-docked);
  pointer-events: none;
}

.content-overlay > * {
  pointer-events: auto;
}

/* ============================================
   Loading States
   ============================================ */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  height: 100%;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.loading-subtext {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ============================================
   Footer / Timeline Bar
   ============================================ */

.footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  height: var(--footer-height);
  padding: 0 var(--space-4);
  background-color: var(--bg-base); /* Same as header - matches PNG logo */
  border-top: 1px solid var(--border-subtle);
  z-index: var(--z-sticky);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-text {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ============================================
   Timeline / Animation Player
   ============================================ */

.timeline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: var(--space-4);
}

/* Playback Controls */
.timeline-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* Frame info - position to the right of controls */
.timeline-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 130px;
}

/* Speed control - keep compact */
.timeline-speed {
  position: relative;
}

.timeline-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.timeline-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.timeline-btn:active {
  transform: scale(0.95);
}

.timeline-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.timeline-btn--primary {
  width: 36px;
  height: 36px;
  background-color: var(--accent-primary);
  color: white;
  border-radius: var(--radius-full);
}

.timeline-btn--primary:hover {
  background-color: var(--accent-primary-hover);
  color: white;
}

.timeline-btn--toggle[aria-pressed="true"] {
  color: var(--accent-selected);
  background-color: var(--accent-selected-light);
}

.timeline-btn--toggle[aria-pressed="true"]:hover {
  background-color: rgba(141, 138, 167, 0.28);
}

.timeline-btn--small {
  width: auto;
  min-width: 36px;
  padding: 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.timeline-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-subtle);
  margin: 0 var(--space-2);
}

/* Timeline Track */
.timeline-track-container {
  flex: 1;
  position: relative;
  padding: var(--space-2) 0;
}

.timeline-track {
  position: relative;
  height: 6px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: height var(--transition-fast);
}

.timeline-track:hover {
  height: 8px;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s linear;
  pointer-events: none;
  transition: width 0.1s linear;
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background-color: var(--accent-primary);
  border: 2px solid white;
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  cursor: grab;
  opacity: 0;
  transition:
    left 0.5s linear,
    opacity var(--transition-fast),
    transform var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.timeline-track:hover .timeline-thumb,
.timeline-thumb:focus,
.timeline-thumb.is-dragging {
  opacity: 1;
}

.timeline-thumb:active,
.timeline-thumb.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
}

.timeline-markers {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-1);
  pointer-events: none;
}

.timeline-marker {
  width: 2px;
  height: 4px;
  background-color: var(--border-default);
  border-radius: var(--radius-full);
}

/* Frame Info */
.timeline-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 130px;
}

.timeline-scantime {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.timeline-scantime--stale {
  color: var(--accent-danger);
  letter-spacing: 0.02em;
}

.timeline-stale-age {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-danger);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Speed Control */
.timeline-speed {
  position: relative;
  flex-shrink: 0;
}

.speed-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: var(--space-2);
  padding: var(--space-1);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
}

.speed-option {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}

/* Speed Slider Popup */
.speed-slider-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: var(--space-2);
  padding: var(--space-3);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  min-width: 200px;
}

.speed-slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.speed-adjust-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.speed-adjust-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.speed-adjust-btn:active {
  transform: scale(0.95);
}

.speed-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-primary);
  border: 2px solid white;
  border-radius: 50%;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.speed-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.speed-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent-primary);
  border: 2px solid white;
  border-radius: 50%;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}

.speed-slider::-moz-range-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
}

.speed-indicator {
  margin-top: var(--space-2);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent-primary);
}

.speed-option:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.speed-option--active {
  color: var(--accent-selected);
  font-weight: var(--font-medium);
}

/* Playing State */
.timeline-bar.is-playing .icon-play {
  display: none;
}

.timeline-bar.is-playing .icon-pause {
  display: block;
}

/* Loading frame indicator during timeline scrubbing */
.timeline-bar.timeline--loading-frame .timeline-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 4px,
    rgba(var(--accent-rgb), 0.3) 4px,
    rgba(var(--accent-rgb), 0.3) 8px
  );
  animation: timeline-loading-slide 0.5s linear infinite;
  pointer-events: none;
}

@keyframes timeline-loading-slide {
  from {
    transform: translateX(-8px);
  }
  to {
    transform: translateX(0);
  }
}

/* ============================================
   Sidebar (for settings panel)
   ============================================ */

.sidebar {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: var(--footer-height);
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform var(--transition-normal) var(--ease-out);
  z-index: var(--z-modal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.sidebar-close:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-content {
  padding: var(--space-4);
}

/* ============================================
   Settings Panel
   ============================================ */

.settings-section {
  margin-bottom: var(--space-6);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section-title svg {
  color: var(--accent-primary);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.settings-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.settings-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.settings-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.settings-label-text {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.settings-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-left: 24px;
}

.settings-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.settings-select:hover {
  border-color: var(--border-strong);
}

.settings-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Viewer profile fields (Location section) */
.viewer-profile-fields {
  margin-top: var(--space-3);
  margin-left: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

/* Viewer saved profiles - match host (Remote Access panel) styling */
.viewer-saved-profiles-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  min-width: 0;
}

.viewer-saved-profiles-dropdown {
  position: relative;
  width: 100%;
}

.viewer-saved-profiles-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 6px);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.viewer-saved-profiles-trigger:hover {
  border-color: var(--border-default, rgba(255, 255, 255, 0.2));
}

.viewer-saved-profiles-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.viewer-saved-profiles-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-surface, var(--bg-elevated));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: calc(var(--z-docked) + 10);
  pointer-events: none;
}

.viewer-saved-profiles-panel > * {
  pointer-events: auto;
}

.viewer-saved-profiles-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.viewer-saved-profiles-item:last-child {
  border-bottom: none;
}

.viewer-saved-profiles-item:hover {
  background: var(--bg-hover);
}

.viewer-saved-profiles-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-saved-profiles-item-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
}

.viewer-saved-profiles-item-delete:hover {
  background: rgba(188, 24, 35, 0.2);
  color: var(--accent-danger);
}

.viewer-saved-profiles-empty {
  padding: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
  pointer-events: none;
}

/* Save profile button - match host ra-copy-btn styling */
.viewer-save-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  align-self: flex-start;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.viewer-save-profile-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default, rgba(255, 255, 255, 0.2));
}

.viewer-profile-fields .settings-row {
  display: flex;
  gap: var(--space-2);
  min-width: 0;
}

.viewer-profile-fields .settings-row .settings-field {
  flex: 1;
  min-width: 0;
}

.viewer-profile-fields .settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.viewer-profile-fields input[type="text"],
.viewer-profile-fields input[type="file"],
.viewer-profile-fields textarea#viewer-profile-notes {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 6px);
  color: var(--text-primary);
}

.viewer-profile-fields input[type="text"]:focus,
.viewer-profile-fields textarea#viewer-profile-notes:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.viewer-profile-notes-field {
  margin-top: var(--space-1);
}

.viewer-profile-fields textarea#viewer-profile-notes {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.viewer-profile-picture-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.viewer-profile-picture-row input[type="file"] {
  flex: 1;
}

.viewer-profile-camera-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 6px);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.viewer-profile-camera-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.viewer-profile-clear-picture {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.viewer-profile-clear-picture:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default, rgba(255, 255, 255, 0.2));
}

.viewer-profile-preview {
  margin-top: var(--space-2);
}

.viewer-profile-preview + .viewer-save-profile-btn {
  margin-top: var(--space-3);
}

.viewer-profile-preview-wrapper {
  position: relative;
  display: inline-block;
}

.viewer-profile-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.viewer-profile-preview-remove:hover {
  background: rgba(188, 24, 35, 0.9);
}

.viewer-profile-preview-img {
  max-width: 80px;
  max-height: 80px;
  border-radius: var(--radius-md, 6px);
  object-fit: cover;
}

.settings-coords {
  display: flex;
  gap: var(--space-2);
}

.settings-coord-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.settings-coord-input label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.settings-coord-input input {
  width: 100%;
  padding: var(--space-2);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.settings-coord-input input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.settings-slider-row input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.settings-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
}

.settings-slider-value {
  min-width: 40px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: right;
}

/* Editable slider value input */
.settings-slider-input {
  width: 50px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  text-align: right;
  -moz-appearance: textfield; /* Hide spinner in Firefox */
}

.settings-slider-input::-webkit-outer-spin-button,
.settings-slider-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.settings-slider-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-transparent);
}

.settings-slider-unit {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-left: var(--space-1);
}

.nws-alert-controls {
  margin-left: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nws-alert-controls .settings-slider-row {
  align-items: center;
}

.nws-alert-alpha-value {
  min-width: 42px;
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* NWS Event Type Selector */
.nws-event-type-selector {
  position: relative;
}

.nws-event-type-trigger {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  transition: border-color var(--transition-fast);
  text-align: left;
}

.nws-event-type-trigger:hover {
  border-color: var(--border-strong);
}

.nws-event-type-trigger:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.nws-event-type-trigger[aria-expanded="true"] .nws-event-type-chevron {
  transform: rotate(180deg);
}

.nws-event-type-trigger-text {
  flex: 1;
  min-width: 0;
}

.nws-event-type-trigger #nws-event-type-status {
  font-weight: 600;
  color: var(--text-primary);
}

.nws-event-type-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.nws-event-type-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  margin-top: 4px;
  background: var(--bg-secondary, #0d1520);
  border: 1px solid var(--border-secondary, rgba(100, 180, 255, 0.2));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow: hidden;
}

.nws-event-type-panel.hidden {
  display: none;
}

.nws-event-type-filter-section {
  padding: 8px;
  border-bottom: 1px solid var(--border-default);
}

.nws-event-type-filter-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.nws-event-type-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}

.nws-event-type-filter-grid .settings-label {
  margin: 0;
  font-size: var(--text-xs);
}

.nws-event-type-search {
  margin: 8px;
  padding: 6px 8px;
  background: var(--bg-tertiary, #1a2a3a);
  border: 1px solid var(--border-secondary, rgba(100, 180, 255, 0.15));
  border-radius: 4px;
  color: var(--text-primary, #e8f0f8);
  font-size: var(--text-xs, 0.75rem);
  outline: none;
}

.nws-event-type-search:focus {
  border-color: var(--accent, #66ccff);
}

.nws-event-type-actions {
  display: flex;
  gap: 6px;
  padding: 0 8px 6px;
}

.nws-event-type-actions button {
  flex: 1;
  padding: 4px 0;
  font-size: var(--text-xs, 0.75rem);
  background: var(--bg-tertiary, #1a2a3a);
  border: 1px solid var(--border-secondary, rgba(100, 180, 255, 0.15));
  border-radius: 4px;
  color: var(--text-secondary, #b0c8e0);
  cursor: pointer;
  transition: background 0.15s;
}

.nws-event-type-actions button:hover {
  background: var(--bg-hover, #223344);
}

.nws-event-type-list {
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nws-event-type-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 3px;
  cursor: pointer;
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-secondary, #b0c8e0);
  transition: background 0.1s;
}

.nws-event-type-item:hover {
  background: rgba(100, 180, 255, 0.08);
}

.nws-event-type-item input[type="checkbox"] {
  flex-shrink: 0;
}

.nws-event-type-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.nws-event-type-item span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   Dual Range Slider (for dBZ filter)
   ============================================ */

.dual-range-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.dual-range-input {
  width: 56px;
  flex-shrink: 0;
}

.dual-range-slider {
  position: relative;
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
}

.dual-range-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.dual-range-selected {
  position: absolute;
  height: 6px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  pointer-events: none;
}

/* Hide the default range track */
.dual-range-thumb {
  position: absolute;
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

/* Style the thumb for webkit browsers */
.dual-range-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: var(--shadow-md);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.dual-range-thumb::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-lg);
}

.dual-range-thumb::-webkit-slider-thumb:active {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(42, 17, 152, 0.3);
}

/* Style the thumb for Firefox */
.dual-range-thumb::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: var(--shadow-md);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.dual-range-thumb::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-lg);
}

.dual-range-thumb::-moz-range-thumb:active {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(42, 17, 152, 0.3);
}

/* Firefox track styling (hide it) */
.dual-range-thumb::-moz-range-track {
  background: transparent;
  border: none;
}

/* Ensure min thumb appears above max when overlapping */
.dual-range-min {
  z-index: var(--z-raised);
}

.dual-range-max {
  z-index: var(--z-above);
}

/* Focus states */
.dual-range-thumb:focus {
  outline: none;
}

.dual-range-thumb:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(42, 17, 152, 0.4);
}

.dual-range-thumb:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(42, 17, 152, 0.4);
}

/* Disabled state for range controls when filter is off */
.dbz-dual-range-container.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.dbz-dual-range-container.is-disabled .dual-range-thumb {
  cursor: not-allowed;
}

/* Disabled state when sync to palette is active */
#dbz-filter-manual-controls.is-synced {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

#dbz-filter-manual-controls.is-synced::after {
  content: "Controlled by palette sync";
  position: absolute;
  top: 0;
  right: 0;
  font-size: var(--text-xs);
  color: var(--accent-primary);
  background: var(--bg-overlay);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

/* About Section */
.settings-section--about {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.settings-about {
  text-align: center;
}

.settings-about-name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.settings-about-version {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.settings-about-copyright {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Header Settings Button */
.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.header-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.header-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ============================================
   Overlay / Backdrop
   ============================================ */

.backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-normal),
    visibility var(--transition-normal);
  z-index: var(--z-overlay);
}

.backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Modal
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(var(--blur-sm));
}

.modal-content {
  position: relative;
  max-width: 480px;
  width: calc(100% - var(--space-8));
  max-height: calc(100vh - var(--space-16));
  background-color: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  max-height: calc(100vh - var(--space-32));
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   Keyboard Shortcuts Modal
   ============================================ */

.shortcuts-section {
  margin-bottom: var(--space-5);
}

.shortcuts-section:last-child {
  margin-bottom: 0;
}

.shortcuts-section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-3) 0;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.shortcut-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ============================================
   Notification Toast Area
   ============================================ */

.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInFromRight var(--transition-normal) var(--ease-out);
}

.toast--success {
  border-left: 3px solid var(--accent-success);
}

.toast--warning {
  border-left: 3px solid var(--accent-warning);
}

.toast--error {
  border-left: 3px solid var(--accent-danger);
}

.toast--info {
  border-left: 3px solid var(--accent-info);
}

.toast-message {
  flex: 1;
  font-size: var(--text-sm);
}

.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Product toolbar & site-info CSS removed — replaced by header dropdowns */

/* ============================================
   Radar Opacity Control
   ============================================ */

.opacity-control {
  position: absolute;
  bottom: calc(var(--space-4) + 48px);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  z-index: var(--z-docked);
}

/* Palette selector positioning */
#palette-selector {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-docked);
}

.opacity-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.opacity-label svg {
  opacity: 0.7;
}

.opacity-slider {
  width: 100px;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  cursor: grab;
  transition: transform var(--transition-fast);
}

.opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.opacity-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.opacity-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: grab;
}

.opacity-slider:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.opacity-value {
  min-width: 36px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  text-align: right;
}

/* ============================================
   Color Legend Panel
   ============================================ */

.legend-panel {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  padding: var(--space-2);
  background-color: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  z-index: var(--z-docked);
}

.legend-gradient {
  width: 24px;
  height: 200px;
  border-radius: var(--radius-sm);
}

.legend-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ============================================
   Empty / Error States
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 320px;
}

.error-state {
  color: var(--accent-danger);
}

/* ============================================
   Focus Management
   ============================================ */

/* Global focus ring for keyboard navigation */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background-color: var(--accent-primary);
  color: white;
  border-radius: var(--radius-sm);
  z-index: var(--z-max);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================================
   Scrollbar Styling (App-wide)
   ============================================ */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-elevated) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-strong);
}

/* ============================================
   Analysis Tool Buttons
   ============================================ */

.analysis-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.analysis-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.analysis-btn.is-active {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.analysis-btn.is-active:hover {
  background: var(--accent-primary-hover);
}

.analysis-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .header,
  .footer,
  .sidebar,
  .toast-container {
    display: none !important;
  }

  .main-content {
    height: auto;
    overflow: visible;
  }

  body {
    background-color: white;
    color: black;
  }
}

/* =============================================================================
   Inline Cross-Section Floating Panel
   ============================================================================= */

.cs-inline-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 240px;
  /* Never exceed viewport width on narrow phones. */
  max-width: calc(100vw - 24px);
  /* min() picks the tighter of: the layout-aware calc that accounts for
   * header/footer heights, and a dynamic-viewport-height fallback used
   * when those vars aren't right (iOS Safari address bar, etc.). */
  max-height: min(
    calc(100vh - var(--header-height) - var(--footer-height) - 24px),
    calc(100dvh - 120px)
  );
  overflow-y: auto;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-docked);
  padding: 0;
  transform: translateX(0);
  opacity: 1;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* Phones: take more of the available width so the inputs are easier to
 * tap, and use the dynamic viewport for height so the panel fits within
 * the embed's header + bottom toolbar without spilling off the screen. */
@media (max-width: 560px) {
  .cs-inline-panel {
    width: calc(100vw - 16px);
    top: 8px;
    right: 8px;
    max-height: calc(100dvh - 130px);
  }
}

.cs-inline-panel.cs-panel-hidden {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}

.cs-inline-panel.cs-settings-collapsed {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  overflow: hidden;
  border-radius: 999px;
}

.cs-inline-panel.cs-settings-collapsed .cs-panel-header,
.cs-inline-panel.cs-settings-collapsed .cs-panel-section,
.cs-inline-panel.cs-settings-collapsed .cs-panel-resize-handle {
  display: none;
}

.cs-inline-panel.cs-settings-collapsed .cs-panel-reopen {
  display: flex;
}

@media (max-width: 1024px), (pointer: coarse) {
  .cs-inline-panel.cs-settings-collapsed {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
  }
}

/* Panel header */
.cs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.cs-panel-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.cs-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cs-panel-icon-btn,
.cs-panel-reopen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cs-panel-icon-btn {
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
}

.cs-panel-icon-btn svg,
.cs-panel-reopen svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs-panel-reopen {
  display: none;
  width: 48px;
  height: 48px;
  margin: 2px;
  border-radius: 999px;
}

.cs-panel-reopen svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 1024px), (pointer: coarse) {
  .cs-panel-reopen {
    width: 52px;
    height: 52px;
  }
}

.cs-panel-icon-btn:hover,
.cs-panel-reopen:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Panel sections */
.cs-panel-section {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.cs-panel-section:last-child {
  border-bottom: none;
}

.cs-panel-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Product grid */
.cs-panel-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.cs-panel-product {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.cs-panel-product input {
  accent-color: var(--accent-primary);
  margin: 0;
  width: 12px;
  height: 12px;
}

.cs-panel-product input:checked + span {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* Sliders */
.cs-panel-slider-row {
  margin-bottom: var(--space-2);
}

.cs-panel-slider-row:last-child {
  margin-bottom: 0;
}

.cs-panel-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.cs-panel-slider-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.cs-panel-slider {
  width: 100%;
  height: 4px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Readout area (GR2A-style hover values) */
.cs-panel-readout {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3) !important;
}

.cs-readout-row {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Checkbox row */
.cs-panel-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
}

.cs-panel-checkbox input {
  accent-color: var(--accent-primary);
  margin: 0;
}

.cs-panel-checkbox input:checked + span {
  color: var(--text-primary);
}

.cs-env-checkbox {
  margin-top: var(--space-2);
}

.cs-env-dot {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 1px;
  vertical-align: middle;
  margin-right: 2px;
}

.cs-env-freeze {
  background: #ffd700;
}

.cs-env-m20 {
  background: #ff2222;
}

/* Two-button row (New Line + Refresh) */
.cs-panel-btn-row {
  display: flex;
  gap: var(--space-2);
}

.cs-panel-refresh-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cs-panel-refresh-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.cs-panel-status {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--text-secondary);
}

.cs-panel-status[data-level="ok"] {
  color: var(--text-primary);
}

.cs-panel-status[data-level="warning"] {
  color: #ffd166;
}

.cs-panel-status[data-level="error"] {
  color: #ff7b7b;
}

/* Frame navigation buttons row */
.cs-panel-frame-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4) !important;
}

.cs-panel-frame-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 28px;
  padding: 0;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  transition: all var(--transition-fast);
}

.cs-panel-frame-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.cs-panel-frame-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Panel resize handle (bottom-right corner) */
.cs-panel-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.15) 50%);
  border-radius: 0 0 var(--radius-lg) 0;
  z-index: var(--z-above);
}

.cs-panel-resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.3) 50%);
}

/* Cross-section mode: hide markers, black sky beyond horizon */
.cs-mode-active .maplibregl-marker:not(.cs-height-label-marker),
.cs-mode-active .site-picker-marker,
.cs-mode-active .metar-station,
.cs-mode-active .context-marker {
  display: none !important;
}

.cs-mode-active {
  background-color: #000 !important;
}

.cs-mode-active .maplibregl-canvas {
  background-color: #000 !important;
}

/* Height labels (positioned via MapLibre markers) */
.cs-height-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-family: var(--font-mono);
  text-shadow:
    0 0 4px rgba(0, 0, 0, 0.9),
    0 0 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* =============================================================================
   Inline Volume Explorer - Overlay & Floating Panel
   ============================================================================= */

/* Three.js overlay canvas container */
.vol-inline-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-float);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vol-inline-overlay.vol-visible {
  opacity: 1;
}

.vol-inline-overlay canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Floating glassmorphism panel (mirrors .cs-inline-panel) */
.vol-inline-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: var(--vol-inline-panel-width, 248px);
  max-width: calc(100vw - 24px);
  max-height: min(
    620px,
    calc(100vh - var(--header-height) - var(--footer-height) - 32px),
    calc(100dvh - var(--header-height) - var(--footer-height) - 32px)
  );
  overflow-y: auto;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-docked);
  padding: 0;
  transform: translateX(0);
  opacity: 1;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

@media (max-width: 560px) {
  .vol-inline-panel {
    width: calc(100vw - 16px);
    top: 8px;
    right: 8px;
    max-height: calc(100dvh - 130px);
  }
}

@media (min-width: 768px) {
  .vol-inline-header {
    padding: 8px 12px;
  }

  .vol-inline-section {
    padding: 6px 12px;
  }

  .vol-inline-section-title {
    margin-bottom: 6px;
  }

  .vol-inline-radio-row,
  .vol-inline-toggle-row {
    gap: 8px;
  }

  .vol-inline-slider-row {
    gap: 6px;
  }

  .vol-inline-slider-row label {
    min-width: 50px;
  }

  .vol-inline-btn {
    min-width: 62px;
  }
}

.vol-inline-panel.vol-panel-hidden {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}

.vol-inline-panel.vol-settings-collapsed {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  overflow: hidden;
  border-radius: 999px;
}

.vol-inline-panel.vol-settings-collapsed .vol-inline-header,
.vol-inline-panel.vol-settings-collapsed .vol-inline-section,
.vol-inline-panel.vol-settings-collapsed .vol-inline-resize-handle {
  display: none;
}

.vol-inline-panel.vol-settings-collapsed .vol-inline-reopen {
  display: flex;
}

@media (max-width: 1024px), (pointer: coarse) {
  .vol-inline-panel.vol-settings-collapsed {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
  }
}

/* Scrollbar styling */
.vol-inline-panel::-webkit-scrollbar {
  width: 4px;
}

.vol-inline-panel::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

/* Panel header */
.vol-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  cursor: grab;
  user-select: none;
}

.vol-inline-header:active {
  cursor: grabbing;
}

.vol-inline-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.vol-inline-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vol-inline-icon-btn,
.vol-inline-reopen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vol-inline-icon-btn {
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
}

.vol-inline-icon-btn svg,
.vol-inline-reopen svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vol-inline-reopen {
  display: none;
  width: 48px;
  height: 48px;
  margin: 2px;
  border-radius: 999px;
}

.vol-inline-reopen svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 1024px), (pointer: coarse) {
  .vol-inline-reopen {
    width: 52px;
    height: 52px;
  }
}

.vol-inline-icon-btn:hover,
.vol-inline-reopen:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Panel sections */
.vol-inline-section {
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.vol-inline-section:last-child {
  border-bottom: none;
}

.vol-inline-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vol-inline-collapsible {
  cursor: pointer;
  user-select: none;
}

.vol-inline-collapsible::before {
  content: "▾ ";
  font-size: 10px;
}

.vol-inline-collapsible.vol-inline-collapsed::before {
  content: "▸ ";
}

/* Info text */
.vol-inline-info-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-right: var(--space-2);
}

/* Readout */
.vol-inline-readout {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  display: block;
  min-height: 16px;
}

/* Status */
.vol-inline-status {
  font-size: var(--text-xs);
  color: var(--status-warning);
  font-family: var(--font-mono);
  display: block;
}

/* Radio grid (for products) */
.vol-inline-radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.vol-inline-radio-row {
  display: flex;
  gap: var(--space-3);
}

.vol-inline-radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-primary);
  cursor: pointer;
  padding: 2px 0;
}

.vol-inline-radio-label input[type="radio"] {
  margin: 0;
  accent-color: var(--accent-info);
}

/* Toggle row */
.vol-inline-toggle-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

/* Slider rows */
.vol-inline-slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.vol-inline-slider-row label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  min-width: 54px;
  flex-shrink: 0;
}

.vol-inline-slider-row input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: var(--accent-info);
}

.vol-inline-slider-val {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  min-width: 36px;
  text-align: right;
}

/* Checkbox rows */
.vol-inline-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.vol-inline-check-row input[type="checkbox"] {
  margin: 0;
  accent-color: var(--accent-info);
}

.vol-inline-check-row label {
  font-size: var(--text-xs);
  color: var(--text-primary);
  cursor: pointer;
}

/* Action buttons */
.vol-inline-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.vol-inline-btn {
  flex: 1;
  min-width: 70px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.vol-inline-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

/* Color scale */
.vol-inline-color-scale-section {
  padding: var(--space-2) var(--space-4) var(--space-3);
}

.vol-inline-color-scale {
  display: block;
  width: 100%;
  height: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.vol-inline-color-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* Resize handle */
.vol-inline-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: var(--z-above);
}

.vol-inline-resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.3) 50%);
}

/* Loading spinner overlay */
.vol-inline-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-docked);
  pointer-events: none;
}

.vol-inline-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-info);
  border-radius: 50%;
  animation: vol-spin 0.8s linear infinite;
}

@keyframes vol-spin {
  to {
    transform: rotate(360deg);
  }
}

.vol-inline-loading-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
  text-align: center;
}

/* Volume mode: hide markers, black sky beyond horizon */
.vol-mode-active .maplibregl-marker,
.vol-mode-active .site-picker-marker,
.vol-mode-active .metar-station,
.vol-mode-active .context-marker {
  display: none !important;
}

.vol-mode-active {
  background-color: #000 !important;
}

.vol-mode-active .maplibregl-canvas {
  background-color: #000 !important;
}

/* Volume Explorer - Compass Direction Labels */
.vol-compass-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-sans);
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 2px;
  transition:
    font-size 0.15s ease,
    color 0.15s ease;
}

.vol-compass-label.vol-compass-back {
  font-size: 20px;
  color: rgba(255, 255, 255, 1);
  font-weight: 800;
}

.vol-compass-label.vol-compass-front {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}

/* ============================================
   Deferred-CSS FOUC Guards
   Prevent flash of unstyled content for elements
   whose hide rules live in async-loaded stylesheets.
   ============================================ */
.archive-banner {
  display: none;
}

/* === forecast-card.css === */
/* ==========================================================================
   FORECAST CARD — Draggable Floating Popup
   Opens near the click point as a popup window the user can drag around.
   Internal card styles live inside the preview HTML (self-contained).
   ========================================================================== */

/* -- Popup Card (positioned by JS near click point) -- */
.forecast-overlay-card {
  position: fixed;
  z-index: calc(var(--z-fullscreen) + 2);
  background: linear-gradient(135deg, #1a2a3a 0%, #0d1520 100%);
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  width: 600px;
  max-width: calc(100vw - 20px);
  height: calc(100vh - var(--header-height) - var(--footer-height) - 20px);
  max-height: calc(100vh - var(--header-height) - var(--footer-height) - 20px);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #e8f0f8;
  overflow: hidden;
  animation: forecastPopupIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  resize: both;
}

.forecast-overlay-card.hidden {
  display: none !important;
}

@keyframes forecastPopupIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* -- Header Bar (also serves as drag handle) -- */
.forecast-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(100, 180, 255, 0.15);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

.forecast-overlay-header:active {
  cursor: grabbing;
}

.forecast-overlay-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #66ccff;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.forecast-overlay-close {
  background: none;
  border: none;
  color: #9ab;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition:
    color 0.15s,
    background-color 0.15s;
  border-radius: 4px;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forecast-overlay-close:hover {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
}

/* -- Iframe -- */
.forecast-overlay-iframe {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  border: none;
  background: #0b0f1a;
}

/* -- Responsive: narrower card on small viewports -- */
@media (max-width: 800px) {
  .forecast-overlay-card {
    width: calc(100vw - 20px);
  }
}

/* === remote-access.css === */
/* =============================================================================
   Remote Access Panel

   Styles for the tunnel/remote access sharing panel.
   Uses the existing design system variables from variables.css.
   ============================================================================= */

/* Panel container — slides in from the right */
.remote-access-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition-normal, 0.2s) ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.remote-access-panel.is-open {
  transform: translateX(0);
}

/* Header */
.ra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.ra-header h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.ra-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ra-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Scrollable content */
.ra-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}

/* Sections */
.ra-section {
  margin-bottom: var(--space-6);
}

.ra-section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-3) 0;
}

/* Connection section */
.ra-connect-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.ra-connect-btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ra-connect-btn--start {
  background: var(--accent-success);
  color: white;
}

.ra-connect-btn--start:hover {
  background: #1aad52;
}

.ra-connect-btn--stop {
  background: var(--accent-danger);
  color: white;
}

.ra-connect-btn--stop:hover {
  background: #a51420;
}

.ra-connect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status badge */
.ra-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.ra-status--idle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-tertiary);
}

.ra-status--connecting {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
}

.ra-status--connected {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-success);
}

.ra-status--error {
  background: rgba(188, 24, 35, 0.15);
  color: var(--accent-danger);
}

.ra-status--downloading {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-info);
}

.ra-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.ra-status--connecting .ra-status-dot,
.ra-status--downloading .ra-status-dot {
  animation: ra-pulse 1.5s ease-in-out infinite;
}

@keyframes ra-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Share link name (above URL when connected) */
.ra-share-link-name-row {
  margin-bottom: var(--space-3);
}

.ra-share-link-name-row .ra-profile-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.ra-share-link-name-row .ra-profile-input {
  width: 100%;
}

/* URL display */
.ra-url-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.ra-url-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-info);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.ra-url-text--empty {
  color: var(--text-tertiary);
  font-style: italic;
  font-family: var(--font-sans);
}

/* Share buttons row - Email, Text, Copy link */
.ra-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ra-share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #e07c5e;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.ra-share-btn svg {
  flex-shrink: 0;
}

.ra-share-btn:hover {
  background: rgba(224, 124, 94, 0.15);
  color: #e07c5e;
  border-color: rgba(224, 124, 94, 0.4);
}

.ra-share-btn.ra-copy-btn--copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--accent-success);
  color: var(--accent-success);
}

/* Copy buttons */
.ra-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.ra-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.ra-copy-btn--copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--accent-success);
  color: var(--accent-success);
}

/* Embed code textarea */
.ra-embed-area {
  width: 100%;
  min-height: 80px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  resize: vertical;
  margin-bottom: var(--space-2);
}

/* Security section */
.ra-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.ra-toggle-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.ra-toggle-switch {
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

/* Ensure toggle inputs in Remote Access panel work correctly */
.ra-toggle-switch .toggle {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.ra-key-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.ra-key-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

/* Activity section */
.ra-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.ra-stat {
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  text-align: center;
}

.ra-stat-value {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.ra-stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Access log */
.ra-log {
  max-height: 200px;
  overflow-y: auto;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

.ra-log-entry {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-tertiary);
}

.ra-log-time {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.ra-log-ip {
  flex-shrink: 0;
  color: var(--accent-info);
}

/* Collapsible sections */
.ra-collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: var(--space-2) 0;
  user-select: none;
}

.ra-collapsible-header:hover .ra-section-title {
  color: var(--text-primary);
}

.ra-collapsible-icon {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.ra-collapsible.is-open .ra-collapsible-icon {
  transform: rotate(180deg);
}

.ra-collapsible-body {
  display: none;
}

.ra-collapsible.is-open .ra-collapsible-body {
  display: block;
}

/* Helper text */
.ra-help {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: var(--space-1);
}

/* Download progress bar */
.ra-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: var(--space-2) 0;
}

.ra-progress-bar {
  height: 100%;
  background: var(--accent-info);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Location section - profile fields */
.ra-profile-fields {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ra-saved-profiles-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ra-saved-profiles-dropdown {
  position: relative;
}

.ra-saved-profiles-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.ra-saved-profiles-trigger:hover {
  border-color: var(--border-default);
}

.ra-saved-profiles-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.ra-saved-profiles-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: var(--z-docked);
  /* Allow clicks to pass through panel background to inputs below when panel overlaps */
  pointer-events: none;
}

.ra-saved-profiles-panel > * {
  pointer-events: auto;
}

.ra-saved-profiles-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ra-saved-profiles-item:last-child {
  border-bottom: none;
}

.ra-saved-profiles-item:hover {
  background: var(--bg-hover);
}

.ra-saved-profiles-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ra-saved-profiles-item-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
}

.ra-saved-profiles-item-delete:hover {
  background: rgba(188, 24, 35, 0.2);
  color: var(--accent-danger);
}

.ra-saved-profiles-empty {
  padding: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
  pointer-events: none; /* Allow clicks to pass through to inputs below when panel overlaps */
}

.ra-profile-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.ra-profile-label:first-child {
  margin-top: 0;
}

.ra-profile-picture-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.ra-profile-picture-row input[type="file"] {
  flex: 1;
}

.ra-profile-camera-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ra-profile-camera-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ra-profile-input {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.ra-profile-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.ra-profile-notes {
  resize: vertical;
  min-height: 60px;
}

.ra-profile-preview {
  margin-top: var(--space-2);
}

.ra-profile-preview + #ra-save-profile-btn {
  margin-top: var(--space-3);
}

.ra-save-profile-btn {
  width: fit-content;
  align-self: flex-start;
}

.ra-profile-preview-wrapper {
  position: relative;
  display: inline-block;
}

.ra-profile-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ra-profile-preview-remove:hover {
  background: rgba(188, 24, 35, 0.9);
}

.ra-profile-preview-img {
  max-width: 80px;
  max-height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

/* === messaging.css === */
/* =============================================================================
   WMB Radar - Messaging System Styles

   Floating chat window, chat bubble FAB, conversation list,
   message threads, and notification styles.
   Uses design system variables from variables.css.
   ============================================================================= */

/* =============================================================================
   Chat Bubble FAB (Floating Action Button)
   ============================================================================= */

.chat-bubble-fab {
  position: fixed;
  bottom: calc(var(--footer-height, 48px) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal) var(--ease-in-out);
}

.chat-bubble-fab:hover {
  background: var(--accent-primary-hover);
  box-shadow: var(--shadow-xl);
  transform: scale(1.08);
}

.chat-bubble-fab:active {
  transform: scale(0.95);
}

.chat-bubble-fab.is-active {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
}

.chat-bubble-fab__icon {
  width: 24px;
  height: 24px;
}

.chat-bubble-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent-danger);
  border-radius: var(--radius-full);
  color: white;
  font-size: 11px;
  font-weight: var(--font-bold);
  line-height: 20px;
  text-align: center;
  pointer-events: none;
  animation: chat-badge-pop 0.3s var(--ease-bounce);
}

.chat-bubble-fab__badge.is-hidden {
  display: none;
}

.chat-bubble-fab__dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--accent-info);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  animation: chat-dot-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

.chat-bubble-fab__dot.is-hidden {
  display: none;
}

@keyframes chat-badge-pop {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes chat-dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* =============================================================================
   Floating Chat Window
   ============================================================================= */

.chat-window {
  position: fixed;
  z-index: var(--z-popover);
  display: flex;
  flex-direction: column;
  min-width: 360px;
  min-height: 420px;
  width: 420px;
  height: 600px;
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
  transition:
    opacity var(--transition-normal) var(--ease-in-out),
    transform var(--transition-normal) var(--ease-in-out);
}

.chat-window.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.chat-window.is-minimized {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
}

/* Resize handle */
.chat-window__resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  z-index: var(--z-raised);
}

.chat-window__resize::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  opacity: 0.5;
}

/* =============================================================================
   Chat Window Header (Title Bar)
   ============================================================================= */

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2-5) var(--space-3);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.chat-header:active {
  cursor: grabbing;
}

.chat-header__back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-header__back:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-header__back.is-visible {
  display: flex;
}

.chat-header__title {
  flex: 1;
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* When in thread/compose view, use smaller title */
.chat-header--thread .chat-header__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.chat-header__subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: var(--font-normal);
  margin-left: var(--space-1);
}

.chat-header__actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.chat-header__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-header__btn.is-hidden {
  display: none;
}

.chat-header__btn svg {
  width: 16px;
  height: 16px;
}

/* Video call button in thread header */
.chat-header__videocall {
  color: var(--accent-info);
}

.chat-header__videocall:hover {
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.15);
}

.chat-header__btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* =============================================================================
   Chat Window Body
   ============================================================================= */

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* View panels that swap in/out */
.chat-view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-view.is-active {
  display: flex;
}

/* =============================================================================
   Conversation List View
   ============================================================================= */

.chat-convo-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Search bar row: Edit button + search field */
.chat-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  flex-shrink: 0;
}

.chat-edit-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.chat-edit-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.chat-edit-btn.is-active {
  color: var(--accent-danger);
}

.chat-search__wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chat-search__input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  padding-left: var(--space-9);
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.chat-search__input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.1);
}

.chat-search__input::placeholder {
  color: var(--text-tertiary);
}

.chat-search__icon {
  position: absolute;
  left: var(--space-2-5);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Edit-mode selection circle on each conversation */
.chat-convo-select {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-left: -2px;
}

.chat-convo-select svg {
  width: 14px;
  height: 14px;
}

.chat-convo-select.is-selected {
  background: var(--accent-primary, #6ea8fe);
  border-color: var(--accent-primary, #6ea8fe);
  color: white;
}

/* Edit-mode footer bar */
.chat-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.chat-edit-footer.is-hidden {
  display: none;
}

.chat-edit-footer__count {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.chat-edit-footer__delete {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: none;
  color: var(--accent-danger, #ef4444);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  transition:
    background var(--transition-fast),
    opacity var(--transition-fast);
}

.chat-edit-footer__delete svg {
  width: 14px;
  height: 14px;
}

.chat-edit-footer__delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
}

.chat-edit-footer__delete:disabled {
  opacity: 0.4;
  cursor: default;
}

/* New message button */
.chat-new-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: calc(100% - var(--space-8));
  margin: var(--space-1) var(--space-4) var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--accent-info);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-new-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.chat-new-btn svg {
  width: 16px;
  height: 16px;
}

/* Swipe-to-delete wrapper (iMessage style) */
.chat-convo-swipe-wrapper {
  position: relative;
  overflow: hidden;
}

.chat-convo-delete-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--accent-danger, #ef4444);
  color: white;
  font-size: 11px;
  font-weight: var(--font-medium);
  cursor: pointer;
  user-select: none;
  /* Hidden by default -- revealed only when the user swipes left */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.chat-convo-swipe-wrapper.is-swiping .chat-convo-delete-action,
.chat-convo-swipe-wrapper.is-swiped .chat-convo-delete-action {
  opacity: 1;
  pointer-events: auto;
}

.chat-convo-delete-action svg {
  width: 18px;
  height: 18px;
}

.chat-convo-delete-action:hover {
  background: #dc2626;
}

/* Conversation row - iMessage style layout */
.chat-convo-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform 0.25s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  background: var(--bg-surface);
  z-index: var(--z-above);
  width: 100%;
  box-sizing: border-box;
}

.chat-convo-swipe-wrapper:last-child .chat-convo-item {
  border-bottom: none;
}

.chat-convo-item:hover {
  background: var(--bg-hover);
}

.chat-convo-item.is-active {
  background: var(--bg-active);
}

/* Blue unread dot - sits to the left of the avatar, iMessage style */
.chat-convo-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3478f6;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.chat-convo-dot.is-unread {
  opacity: 1;
}

/* Avatar */
.chat-avatar {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: white;
  overflow: hidden;
}

.chat-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* Avatar with profile picture */
.chat-avatar--img {
  background: transparent !important;
}

.chat-avatar__pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
  display: block;
}

.chat-avatar--broadcast {
  background: var(--accent-info) !important;
}

.chat-avatar__status {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  background: var(--text-tertiary);
  z-index: var(--z-above);
}

.chat-avatar__status.is-online {
  background: var(--accent-success);
}

/* Status dot positioning for picture avatars */
.chat-avatar--img .chat-avatar__status {
  bottom: 0;
  right: 0;
}

/* Conversation info - middle column */
.chat-convo-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.chat-convo-info__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.chat-convo-info__name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Bold the name when unread */
.chat-convo-item--unread .chat-convo-info__name {
  font-weight: var(--font-bold);
}

.chat-convo-info__time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}

.chat-convo-info__preview {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

/* Slightly bolder preview when unread */
.chat-convo-item--unread .chat-convo-info__preview {
  color: var(--text-primary);
}

/* Chevron on the right */
.chat-convo-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* Legacy unread badge - kept for badge count, but hidden by default */
.chat-convo-unread {
  display: none;
}

/* Empty state */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10);
  text-align: center;
}

.chat-empty__icon {
  width: 48px;
  height: 48px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.chat-empty__text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* =============================================================================
   Chat Thread View
   ============================================================================= */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Date separator */
.chat-date-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) 0 var(--space-1);
}

.chat-date-sep__text {
  font-size: 11px;
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  background: var(--bg-overlay);
  padding: var(--space-0-5) var(--space-3);
  border-radius: var(--radius-full);
}

/* Message bubble */
.chat-msg {
  display: flex;
  gap: var(--space-2);
  max-width: 85%;
  animation: chat-msg-in 0.2s var(--ease-out);
}

@keyframes chat-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg--outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg--incoming {
  align-self: flex-start;
}

.chat-msg__avatar {
  flex-shrink: 0;
  align-self: flex-end;
}

.chat-msg__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-msg__sender {
  font-size: 11px;
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  padding: 0 var(--space-2);
}

.chat-msg--outgoing .chat-msg__sender {
  text-align: right;
}

.chat-msg__bubble {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-primary);
  word-wrap: break-word;
  position: relative;
}

.chat-msg--outgoing .chat-msg__bubble {
  background: var(--accent-primary);
  border-bottom-right-radius: var(--radius-sm);
}

.chat-msg--incoming .chat-msg__bubble {
  background: var(--bg-elevated);
  border-bottom-left-radius: var(--radius-sm);
}

/* Priority message styles */
.chat-msg--important .chat-msg__bubble {
  border-left: 3px solid var(--accent-warning);
}

.chat-msg--urgent .chat-msg__bubble {
  border-left: 3px solid var(--accent-danger);
  animation: chat-urgent-pulse 2s ease-in-out infinite;
}

.chat-msg--outgoing.chat-msg--important .chat-msg__bubble,
.chat-msg--outgoing.chat-msg--urgent .chat-msg__bubble {
  border-left: none;
  border-right-width: 3px;
  border-right-style: solid;
}

.chat-msg--outgoing.chat-msg--important .chat-msg__bubble {
  border-right-color: var(--accent-warning);
}

.chat-msg--outgoing.chat-msg--urgent .chat-msg__bubble {
  border-right-color: var(--accent-danger);
}

@keyframes chat-urgent-pulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 8px rgba(188, 24, 35, 0.4);
  }
}

.chat-msg__priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px var(--space-1-5);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}

.chat-msg__priority-badge--important {
  background: var(--accent-warning-light);
  color: var(--accent-warning);
}

.chat-msg__priority-badge--urgent {
  background: var(--accent-danger-light);
  color: var(--accent-danger);
}

/* Pinned message indicator */
.chat-msg--pinned .chat-msg__bubble::before {
  content: "";
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%239ca3af'%3E%3Cpath d='M4.5 10.5L1 14l3.5-3.5zm.5-.5l5-5-3-3-5 5 3 3zm6.5-6.5l2-2-1-1-2 2 1 1z'/%3E%3C/svg%3E")
    center/contain no-repeat;
  opacity: 0.6;
}

/* Message metadata */
.chat-msg__meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
}

.chat-msg--outgoing .chat-msg__meta {
  justify-content: flex-end;
}

.chat-msg__time {
  font-size: 10px;
  color: var(--text-tertiary);
}

.chat-msg__status {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
}

.chat-msg__status--read {
  color: var(--accent-info);
}

.chat-msg__read-receipt {
  font-size: 10px;
  color: var(--accent-info);
  margin-top: 1px;
  line-height: 1;
}

.chat-msg__read-receipt--group {
  position: relative;
  cursor: pointer;
}

.chat-msg__seen-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 8px);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  min-width: 160px;
  max-width: 240px;
  z-index: var(--z-dropdown);
}

.chat-msg__read-receipt--group:hover .chat-msg__seen-tooltip {
  display: block;
}

.chat-msg__seen-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}

.chat-msg__seen-tooltip-pic {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-msg__seen-tooltip-initial {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-primary, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-msg__seen-tooltip-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-msg__seen-tooltip-name {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg__seen-tooltip-time {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.chat-msg__status svg {
  width: 14px;
  height: 14px;
}

/* Typing indicator */
.chat-typing-indicator {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.chat-typing-indicator.is-visible {
  display: flex;
}

.chat-typing-dots {
  display: flex;
  gap: 3px;
}

.chat-typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: chat-typing-bounce 1.4s infinite ease-in-out both;
}

.chat-typing-dots span:nth-child(1) {
  animation-delay: 0s;
}
.chat-typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}
.chat-typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes chat-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* =============================================================================
   Message Input Area
   ============================================================================= */

.chat-input-area {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

/* Quick replies */
.chat-quick-replies {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1-5) var(--space-3) 0;
  overflow-x: auto;
  flex-shrink: 0;
}

.chat-quick-replies::-webkit-scrollbar {
  display: none;
}

.chat-quick-reply-btn {
  flex-shrink: 0;
  padding: var(--space-0-5) var(--space-2);
  font-size: 11px;
  font-weight: var(--font-medium);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chat-quick-reply-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Input row */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.chat-input-field {
  flex: 1;
  max-height: 100px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  resize: none;
  outline: none;
  overflow-y: auto;
  line-height: 1.4;
  transition: border-color var(--transition-fast);
}

.chat-input-field:focus {
  border-color: var(--accent-primary);
}

.chat-input-field::placeholder {
  color: var(--text-tertiary);
}

/* Priority selector */
.chat-priority-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-priority-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-priority-btn.is-important {
  border-color: var(--accent-warning);
  color: var(--accent-warning);
  background: var(--accent-warning-light);
}

.chat-priority-btn.is-urgent {
  border-color: var(--accent-danger);
  color: var(--accent-danger);
  background: var(--accent-danger-light);
}

/* Priority dropdown -- uses position:fixed so it escapes overflow:hidden ancestors */
.chat-priority-dropdown {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: calc(var(--z-popover) + 10);
  display: none;
}

.chat-priority-dropdown.is-open {
  display: block;
}

.chat-priority-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.chat-priority-option:hover {
  background: var(--bg-hover);
}

.chat-priority-option.is-selected {
  background: var(--accent-primary-light);
}

/* Send button */
.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--accent-primary-hover);
}

.chat-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
}

/* =============================================================================
   New Message Composer View
   ============================================================================= */

.chat-compose-recipients {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.chat-compose-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1-5);
}

.chat-compose-to {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}

.chat-compose-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-0-5) var(--space-2);
  background: var(--accent-primary-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-primary);
}

.chat-compose-chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.chat-compose-chip__remove:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.chat-compose-input {
  flex: 1;
  min-width: 100px;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
}

.chat-compose-input::placeholder {
  color: var(--text-tertiary);
}

/* Participant suggestions dropdown */
.chat-compose-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: var(--z-docked);
  display: none;
}

.chat-compose-suggestions.is-open {
  display: block;
}

.chat-compose-suggestion {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chat-compose-suggestion:hover {
  background: var(--bg-hover);
}

.chat-compose-suggestion__name {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.chat-compose-suggestion__org {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* "Everyone" option in the suggestion dropdown */
.chat-compose-suggestion--everyone {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-2);
  margin-bottom: 2px;
}

.chat-compose-suggestion--everyone .chat-compose-suggestion__org {
  color: var(--accent-info, var(--text-tertiary));
  font-style: italic;
}

/* Broadcast chip styling */
.chat-compose-chip--broadcast {
  background: var(--accent-primary, #3b82f6);
  color: #fff;
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

.chat-messages::-webkit-scrollbar,
.chat-convo-list::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-convo-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-convo-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-convo-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   Toast Notification Styles for Messages
   ============================================================================= */

.toast--chat {
  cursor: pointer;
}

.toast--chat .toast-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toast--chat-urgent {
  border-left: 3px solid var(--accent-danger);
}

/* === video-call.css === */
/* =============================================================================
   WMB Radar - Video Call Styles

   Floating video call window, video grid, control bar,
   incoming/connecting/ended views.
   Uses design system variables from variables.css.
   ============================================================================= */

.vc-window {
  position: fixed;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  min-width: 480px;
  min-height: 360px;
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition:
    opacity var(--transition-normal) var(--ease-in-out),
    transform var(--transition-normal) var(--ease-in-out);
}

.vc-window.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.vc-window.is-fullscreen {
  top: var(--header-height, 56px) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: var(--footer-height, 48px) !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0;
}

.vc-window__resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  z-index: var(--z-raised);
}

.vc-window__resize::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  opacity: 0.4;
}

.vc-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.vc-header:active { cursor: grabbing; }

.vc-header__title {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-header__timer {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--accent-success);
  font-family: var(--font-mono);
  min-width: 40px;
}

.vc-header__actions { display: flex; gap: var(--space-1); flex-shrink: 0; }

.vc-header__btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition-fast);
}

.vc-header__btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.vc-header__btn svg { width: 16px; height: 16px; }

.vc-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.vc-view.is-active { display: flex; }

.vc-incoming {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-4); flex: 1;
  padding: var(--space-8); text-align: center;
}

.vc-incoming__avatar {
  width: 96px; height: 96px; border-radius: var(--radius-full);
  background: var(--accent-primary); display: flex; align-items: center;
  justify-content: center; color: white;
  animation: vc-incoming-pulse 2s ease-in-out infinite;
  position: relative; overflow: hidden; flex-shrink: 0;
}

.vc-incoming__avatar-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.vc-incoming__avatar-fallback svg { width: 40px; height: 40px; }
.vc-incoming__avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-full); }

@keyframes vc-incoming-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(42, 17, 152, 0.4); }
  50% { box-shadow: 0 0 0 20px rgba(42, 17, 152, 0); }
}

.vc-incoming__name { font-size: var(--text-xl); font-weight: var(--font-bold); color: var(--text-primary); }
.vc-incoming__label { font-size: var(--text-sm); color: var(--text-secondary); animation: vc-text-pulse 1.5s ease-in-out infinite; }

@keyframes vc-text-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.vc-incoming__actions { display: flex; gap: var(--space-6); margin-top: var(--space-4); }

.vc-ringing {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-3); flex: 1;
  padding: var(--space-6); text-align: center; position: relative;
}

.vc-ringing__avatar { width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--accent-info); display: flex; align-items: center; justify-content: center; color: white; }
.vc-ringing__avatar svg { width: 28px; height: 28px; }
.vc-ringing__name { font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-primary); }
.vc-ringing__label { font-size: var(--text-sm); color: var(--text-secondary); animation: vc-text-pulse 1.5s ease-in-out infinite; }
.vc-ringing__local-preview { width: 160px; height: 120px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-subtle); margin-top: var(--space-2); }
.vc-local-preview-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.vc-connecting { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); flex: 1; padding: var(--space-8); }
.vc-connecting__spinner { width: 48px; height: 48px; border: 3px solid var(--border-subtle); border-top-color: var(--accent-primary); border-radius: 50%; animation: vc-spin 0.8s linear infinite; }
@keyframes vc-spin { to { transform: rotate(360deg); } }
.vc-connecting__label { font-size: var(--text-base); color: var(--text-secondary); }

.vc-video-container { flex: 1; position: relative; background: #0a0a14; overflow: hidden; }
.vc-remote-video { width: 100%; height: 100%; object-fit: contain; background: #0a0a14; }

.vc-no-video { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); background: #0a0a14; }
.vc-no-video__icon { width: 72px; height: 72px; border-radius: var(--radius-full); background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.vc-no-video__icon svg { width: 32px; height: 32px; }
.vc-no-video__name { font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-secondary); }

.vc-pip { position: absolute; bottom: var(--space-4); right: var(--space-4); width: 180px; height: 135px; border-radius: var(--radius-md); overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.15); box-shadow: var(--shadow-lg); z-index: var(--z-raised); cursor: grab; }
.vc-local-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); background: #0a0a14; }

.vc-controls { display: flex; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(var(--blur-lg)); border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.vc-ctrl-btn { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-full); color: var(--text-primary); cursor: pointer; transition: all var(--transition-fast); }
.vc-ctrl-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.2); }
.vc-ctrl-btn.is-muted { background: rgba(188, 24, 35, 0.25); border-color: var(--accent-danger); color: var(--accent-danger); }
.vc-ctrl-btn.is-active { background: rgba(42, 17, 152, 0.3); border-color: var(--accent-primary); color: var(--accent-primary-hover); }
.vc-ctrl-btn--end { background: var(--accent-danger) !important; border-color: var(--accent-danger) !important; color: white !important; width: 56px; }
.vc-ctrl-btn--end:hover { background: #a51420 !important; }
.vc-ctrl-icon { display: flex; align-items: center; justify-content: center; }
.vc-ctrl-icon svg { width: 22px; height: 22px; }

.vc-ended { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); flex: 1; padding: var(--space-8); text-align: center; }
.vc-ended__label { font-size: var(--text-xl); font-weight: var(--font-semibold); color: var(--text-primary); }
.vc-ended__duration { font-size: var(--text-base); color: var(--text-secondary); font-family: var(--font-mono); }
.vc-ended__reason { font-size: var(--text-sm); color: var(--text-tertiary); }
.vc-ended__actions { display: flex; gap: var(--space-3); margin-top: var(--space-4); }

.vc-btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2-5) var(--space-5); font-size: var(--text-sm); font-weight: var(--font-medium); border: none; border-radius: var(--radius-full); cursor: pointer; transition: all var(--transition-fast); }
.vc-btn svg { width: 18px; height: 18px; }
.vc-btn--accept { background: var(--accent-success); color: white; }
.vc-btn--accept:hover { background: #1aad52; }
.vc-btn--reject { background: var(--accent-danger); color: white; }
.vc-btn--reject:hover { background: #a51420; }
.vc-btn--secondary { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border-default); color: var(--text-primary); }
.vc-btn--secondary:hover { background: var(--bg-hover); }

.vc-incoming-toast { position: fixed; top: calc(var(--header-height, 56px) + var(--space-4)); right: var(--space-4); z-index: var(--z-toast); display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); animation: vc-toast-in 0.3s var(--ease-out); max-width: 380px; }
@keyframes vc-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.vc-incoming-toast__info { flex: 1; min-width: 0; }
.vc-incoming-toast__name { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-primary); }
.vc-incoming-toast__label { font-size: var(--text-xs); color: var(--text-secondary); }
.vc-incoming-toast__actions { display: flex; gap: var(--space-2); }
.vc-incoming-toast__btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: none; border-radius: var(--radius-full); color: white; cursor: pointer; transition: all var(--transition-fast); }
.vc-incoming-toast__btn--accept { background: var(--accent-success); }
.vc-incoming-toast__btn--accept:hover { background: #1aad52; }
.vc-incoming-toast__btn--reject { background: var(--accent-danger); }
.vc-incoming-toast__btn--reject:hover { background: #a51420; }
.vc-incoming-toast__btn svg { width: 18px; height: 18px; }

.chat-msg--system { align-self: center !important; max-width: 90% !important; }
.chat-msg--system .chat-msg__bubble { background: transparent !important; text-align: center; font-size: var(--text-xs); color: var(--text-tertiary); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); border: 1px solid var(--border-subtle); }

/* === archive.css === */
/**
 * WMB Radar - Historical Archive Viewer Styles
 *
 * Styles for the archive modal, form controls, and active archive banner.
 * Uses the design system tokens from variables.css and modal patterns from components.css.
 */

.archive-form { display: flex; flex-direction: column; gap: var(--space-4); }
.archive-form-row { display: flex; flex-direction: column; gap: var(--space-1); }
.archive-form-label { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

.archive-form-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background-color: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.archive-form-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-primary-light); }
.archive-form-input[type="date"] { color-scheme: dark; }
.archive-form-input.archive-input-invalid { border-color: var(--accent-danger); box-shadow: 0 0 0 2px var(--accent-danger-light); }
.archive-time-hint { font-size: var(--text-xs); color: var(--text-tertiary); padding-left: var(--space-1); }

.archive-form-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background-color: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.archive-form-select:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-primary-light); }
.archive-form-row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.archive-utc-preview { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background-color: var(--accent-info-light); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--accent-info); }
.archive-utc-preview svg { flex-shrink: 0; }
.archive-loading { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-6); color: var(--text-secondary); }
.archive-loading-spinner { width: 24px; height: 24px; border: 2px solid var(--border-default); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.archive-error { padding: var(--space-3); background-color: var(--accent-danger-light); border-radius: var(--radius-md); color: var(--accent-danger); font-size: var(--text-sm); }

.archive-range-panel { position: absolute; top: calc(100% + var(--space-2)); left: calc(320px + var(--space-2)); width: 280px; background-color: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); z-index: var(--z-dropdown); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); animation: slideDown var(--transition-fast) var(--ease-out); }
.archive-range-panel[hidden] { display: none; }
.archive-range-section { display: flex; flex-direction: column; gap: var(--space-1); }
.archive-range-title { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.archive-range-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }

.archive-time-group { display: flex; align-items: center; gap: var(--space-1); }
.archive-time-fields { display: flex; align-items: center; gap: 0; background-color: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: visible; }
.archive-time-fields:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-primary-light); }
.archive-time-digit { width: 28px; padding: var(--space-2) 2px; background: transparent; border: none; color: var(--text-primary); font-size: var(--text-sm); font-family: var(--font-mono); text-align: center; outline: none; }
.archive-time-digit::placeholder { color: var(--text-tertiary); font-family: var(--font-sans); font-size: var(--text-xs); }
.archive-time-colon { color: var(--text-secondary); font-size: var(--text-sm); font-family: var(--font-mono); font-weight: 600; user-select: none; line-height: 1; }
.archive-time-period { width: 32px; padding: var(--space-2) 2px; background-color: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--text-xs); font-family: var(--font-mono); font-weight: 600; text-align: center; text-transform: uppercase; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.archive-time-period:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-primary-light); }
.archive-time-period::placeholder { color: var(--text-tertiary); font-weight: 400; }
.archive-time-digit.archive-input-invalid, .archive-time-period.archive-input-invalid { color: var(--accent-danger); }

.archive-time-dropdown-wrap { position: relative; }
.archive-time-dropdown { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); min-width: 40px; max-height: 160px; overflow-y: auto; background-color: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: calc(var(--z-dropdown) + 1); margin-top: 2px; scrollbar-width: thin; }
.archive-time-dropdown.is-open { display: block; }
.archive-time-dropdown-item { padding: 4px 8px; font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-primary); text-align: center; cursor: pointer; white-space: nowrap; transition: background-color var(--transition-fast); }
.archive-time-dropdown-item:hover { background-color: var(--bg-hover); color: var(--accent-primary); }
.archive-range-load-btn { width: 100%; margin-top: var(--space-1); }

.archive-banner { display: none; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); background: linear-gradient(135deg, var(--accent-warning-light), var(--accent-info-light)); border-bottom: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-primary); z-index: var(--z-sticky); }
.archive-banner.is-active { display: flex; }
.archive-banner-icon { color: var(--accent-warning); }
.archive-banner-text { font-weight: var(--font-medium); }
.archive-banner-exit { margin-left: var(--space-2); padding: var(--space-0) var(--space-2); background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); color: var(--text-primary); font-size: var(--text-xs); cursor: pointer; transition: background-color var(--transition-fast), border-color var(--transition-fast); }
.archive-banner-exit:hover { background: rgba(255, 255, 255, 0.2); border-color: var(--border-strong); }
.archive-btn-active { color: var(--accent-warning) !important; background-color: var(--accent-warning-light) !important; }
