/* ==========================================================================
   Garmin SeaMaps Marine Pro - Nautical Design System
   ========================================================================== */

:root {
  --bg-deep: #050d1a;
  --bg-panel: rgba(10, 25, 47, 0.88);
  --bg-card: rgba(15, 43, 72, 0.75);
  --bg-hover: rgba(25, 60, 95, 0.85);
  --border-color: rgba(0, 240, 255, 0.2);
  --border-active: #00f0ff;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #00f0ff;
  --accent-green: #00ff88;
  --accent-yellow: #ffcc00;
  --accent-red: #ff0055;
  --accent-garmin: #007cc3;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-hud: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 15px rgba(0, 240, 255, 0.35);
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
}

.mono {
  font-family: var(--font-mono);
}

/* App Container */
#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ==========================================================================
   Top Marine Navigation HUD (Head-Up Display)
   ========================================================================== */
#marine-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: calc(var(--safe-top) + 6px) 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: linear-gradient(180deg, rgba(5, 13, 26, 0.97) 0%, rgba(5, 13, 26, 0.85) 80%, transparent 100%);
  pointer-events: none;
}

#marine-hud > * {
  pointer-events: auto;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.hud-instruments {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 5px 9px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-hud);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.hud-card.clickable {
  cursor: pointer;
}

.hud-card.clickable:active {
  transform: scale(0.97);
  border-color: var(--accent-cyan);
}

.hud-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.hud-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1.1;
}

.hud-value.speed {
  font-size: 22px;
  color: var(--text-primary);
}

.hud-speed-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hud-unit-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.15);
  padding: 2px 5px;
  border-radius: 4px;
}

/* Compass Needle Icon */
.hud-compass-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 240, 255, 0.08);
}

#hud-compass-needle {
  width: 2px;
  height: 18px;
  background: linear-gradient(180deg, var(--accent-red) 50%, var(--accent-cyan) 50%);
  border-radius: 1px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Coordinates & Status */
.hud-card-coords {
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  flex: none;
}

.hud-coords-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.gps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hud-coords-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.status-badge.clickable {
  cursor: pointer;
}

.status-badge.clickable:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.status-badge.ok {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.4);
}

.status-badge.sim {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.status-badge.warn {
  background: rgba(255, 187, 0, 0.2);
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 187, 0, 0.5);
  animation: pulse-warn 2s infinite ease-in-out;
}

@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 187, 0, 0.4); }
  50% { box-shadow: 0 0 6px 2px rgba(255, 187, 0, 0.3); }
}

.status-badge.error {
  background: rgba(255, 0, 85, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(255, 0, 85, 0.4);
}

.hud-geohash-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.geohash-label {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

.geohash-tag {
  color: var(--accent-yellow);
  background: rgba(255, 204, 0, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 204, 0, 0.25);
}

.geohash-tag:hover {
  background: rgba(255, 204, 0, 0.25);
}

/* Chart Mode Quick Pill Toggle in HUD */
.hud-mode-pill {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: var(--shadow-hud);
  flex-shrink: 0;
}

.mode-pill-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--text-secondary);
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-pill-btn:hover {
  color: var(--text-primary);
}

.mode-pill-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(2, 132, 199, 0.35) 100%);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.mode-pill-btn#btn-mode-sonar.active {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 200, 180, 0.35) 100%);
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.mode-pill-btn .pill-icon {
  font-size: 12px;
}

/* Quick Action: Garmin Map Button */
.btn-garmin-direct {
  background: linear-gradient(135deg, #007cc3 0%, #004d80 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 124, 195, 0.4);
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-garmin-direct:hover {
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
  transform: translateY(-1px);
}

.btn-garmin-direct:active {
  transform: scale(0.96);
}

.garmin-logo-icon {
  color: #00f0ff;
  font-size: 12px;
}

/* Chart Mode Floating Badge on Map */
.chart-mode-badge {
  position: absolute;
  top: calc(var(--safe-top) + 68px);
  left: 12px;
  z-index: 999;
  background: rgba(5, 13, 26, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-hud);
  color: var(--text-primary);
  pointer-events: none;
  transition: all 0.3s ease;
}

.chart-mode-badge.sonar-active {
  border-color: var(--accent-green);
  background: rgba(5, 20, 15, 0.88);
  color: #a7f3d0;
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.35);
}

.chart-mode-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.chart-mode-badge.sonar-active .badge-dot {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-sonar 1.5s infinite;
}

@keyframes pulse-sonar {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Dock Sonar Button Active Glow */
#btn-sonar-toggle.active {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.4);
}

/* ==========================================================================
   Map Viewport & Leaflet Adjustments
   ========================================================================== */
#map-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: #061121;
}

/* Leaflet Marine Custom Zoom Controls */
.leaflet-bottom.leaflet-right {
  bottom: calc(var(--safe-bottom) + 74px) !important;
  right: 12px !important;
  z-index: 990;
}

.leaflet-control-zoom.leaflet-bar {
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: var(--shadow-hud) !important;
  background: var(--bg-panel) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.leaflet-control-zoom.leaflet-bar a {
  background: rgba(10, 25, 47, 0.88) !important;
  color: var(--accent-cyan) !important;
  border-bottom: 1px solid rgba(0, 210, 255, 0.15) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
}

.leaflet-control-zoom.leaflet-bar a:last-child {
  border-bottom: none !important;
}

.leaflet-control-zoom.leaflet-bar a:hover,
.leaflet-control-zoom.leaflet-bar a:active {
  background: rgba(0, 240, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.4) !important;
}

.leaflet-control-zoom.leaflet-bar a.leaflet-disabled {
  background: rgba(10, 25, 47, 0.5) !important;
  color: rgba(255, 255, 255, 0.25) !important;
  cursor: default !important;
}

/* Custom Boat Marker */
.boat-div-icon {
  background: transparent;
  border: none;
}

.boat-cursor-wrap {
  width: 40px;
  height: 60px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: center center;
}

.boat-vessel-img {
  width: 100%;
  height: 100%;
  display: block;
}

.anchor-pin {
  width: 32px;
  height: 32px;
  background: var(--bg-panel);
  border: 2px solid var(--accent-yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.5);
}

/* Waypoints */
.wp-custom-icon {
  background: transparent;
  border: none;
}

.waypoint-pin {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 25, 47, 0.9);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.wp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 0 6px var(--accent-yellow);
}

.waypoint-pin span {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

/* Nautical Popups */
.leaflet-popup-content-wrapper {
  background: var(--bg-panel) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  border-radius: 12px !important;
  box-shadow: var(--shadow-hud) !important;
  backdrop-filter: blur(16px);
}

.leaflet-popup-tip {
  background: var(--bg-panel) !important;
}

.nautical-popup h4 {
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.popup-coords {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.popup-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  margin-bottom: 10px;
}

.btn-popup-delete {
  background: rgba(255, 0, 85, 0.2);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

/* Floating Measure Bar */
.measure-bar {
  position: absolute;
  top: calc(var(--safe-top) + 70px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-panel);
  border: 1px solid var(--accent-yellow);
  padding: 8px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  box-shadow: var(--shadow-hud);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.measure-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.measure-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.measure-val {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.measure-bearing {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-mini {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  cursor: pointer;
}

/* ==========================================================================
   Bottom Marine Touch Dock (Smartphone & Tablet)
   ========================================================================== */
#marine-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px 12px calc(var(--safe-bottom) + 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(0deg, rgba(5, 13, 26, 0.96) 0%, rgba(5, 13, 26, 0.85) 80%, transparent 100%);
  overflow-x: auto;
  scrollbar-width: none;
}

#marine-dock::-webkit-scrollbar {
  display: none;
}

.dock-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-secondary);
  padding: 8px 10px;
  min-width: 52px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  box-shadow: var(--shadow-hud);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dock-btn .btn-icon {
  font-size: 18px;
  line-height: 1;
}

.dock-btn .btn-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.dock-btn:active {
  transform: scale(0.92);
}

.dock-btn.active {
  border-color: var(--border-active);
  background: rgba(0, 240, 255, 0.18);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Modals & Drawers (Mobile Touch Optimized)
   ========================================================================== */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-wrap.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-drawer {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(var(--safe-bottom) + 24px);
  box-shadow: var(--shadow-hud);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-wrap.visible .modal-drawer {
  transform: translateY(0);
}

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

.drawer-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Layer Options Grid */
.layer-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.layer-option-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.layer-option-card:hover {
  background: var(--bg-hover);
}

.layer-option-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: var(--shadow-glow);
}

.layer-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.layer-badge.highlight {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.4);
}

.layer-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.layer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.layer-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Form & Settings Controls */
.drawer-section {
  margin-bottom: 18px;
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.section-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-card input {
  display: none;
}

.radio-card:has(input:checked) {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
}

.marine-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: var(--bg-card);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  position: relative;
  transition: 0.2s;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: 0.2s;
}

.toggle-control input:checked + .toggle-slider {
  background: var(--accent-cyan);
}

.toggle-control input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 12px;
  font-weight: 600;
}

.marine-slider {
  width: 100%;
  accent-color: var(--accent-yellow);
  height: 8px;
  border-radius: 4px;
  margin: 10px 0;
}

.marine-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.marine-input:focus {
  border-color: var(--accent-cyan);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #00f0ff 0%, #0099cc 100%);
  border: none;
  color: #050d1a;
  padding: 14px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}

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

.btn-danger {
  width: 100%;
  background: linear-gradient(135deg, #ff0055 0%, #b3003b 100%);
  border: none;
  color: #ffffff;
  padding: 14px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
}

.anchor-status-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.anchor-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.status-text {
  font-size: 13px;
  font-weight: 700;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
}

.status-text.safe {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
}

.status-text.danger {
  background: rgba(255, 0, 85, 0.25);
  color: var(--accent-red);
  animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 80px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10, 25, 47, 0.95);
  border: 1px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-hud);
  backdrop-filter: blur(16px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Night Mode (Red-Shift Anti-Glare Vision)
   ========================================================================== */
body.night-mode {
  --bg-deep: #0e0000;
  --bg-panel: rgba(26, 5, 5, 0.92);
  --bg-card: rgba(45, 10, 10, 0.85);
  --border-color: rgba(255, 34, 0, 0.35);
  --border-active: #ff3300;
  --text-primary: #ff8888;
  --text-secondary: #cc5555;
  --text-muted: #883333;
  --accent-cyan: #ff3300;
  --accent-green: #ff6600;
  --accent-yellow: #ff9900;
  --shadow-glow: 0 0 15px rgba(255, 51, 0, 0.4);
}

body.night-mode #map {
  filter: brightness(0.65) contrast(1.2) sepia(1) hue-rotate(-50deg) saturate(3);
}

/* ==========================================================================
   Responsive Adaptations (Tablet & Desktop Landscape)
   ========================================================================== */
/* ==========================================================================
   Responsive Adaptations (Tablet, Desktop & Narrow Smartphones)
   ========================================================================== */

/* Tablet & Desktop (768px+) */
@media (min-width: 768px) {
  #marine-hud {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-top) + 12px) 20px 12px;
    gap: 12px;
  }

  .hud-top-row {
    width: auto;
    gap: 12px;
  }

  .hud-card-coords {
    width: auto;
    flex: 1;
    max-width: 420px;
  }

  .hud-card {
    padding: 8px 16px;
  }

  .hud-value {
    font-size: 22px;
  }

  .hud-value.speed {
    font-size: 28px;
  }

  .hud-coords-text {
    font-size: 13px;
  }

  #marine-dock {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hud);
    padding: 8px 14px;
    justify-content: center;
  }

  .modal-drawer {
    border-radius: 24px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
  }
}

/* Smartphone Base (< 768px) */
@media (max-width: 767px) {
  #marine-hud {
    padding: calc(var(--safe-top) + 4px) 6px 4px;
    gap: 4px;
  }

  /* Redundant floating badge: hide on mobile to give full chart visibility */
  .chart-mode-badge {
    display: none !important;
  }

  .hud-top-row {
    gap: 4px;
  }

  .hud-instruments {
    gap: 4px;
  }

  .hud-actions {
    gap: 4px;
  }

  /* Compact Garmin Direct Button: Icon-only on mobile */
  .btn-garmin-direct {
    padding: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-shrink: 0;
  }

  .btn-garmin-direct .btn-text {
    display: none !important;
  }

  .btn-garmin-direct .garmin-logo-icon {
    font-size: 14px;
    line-height: 1;
  }

  /* Compact Captain Account Button: Avatar + Status dot only on mobile */
  .btn-captain-account {
    padding: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 0;
    flex-shrink: 0;
  }

  .btn-captain-account .captain-btn-text {
    display: none !important;
  }

  .btn-captain-account .captain-avatar-icon {
    font-size: 15px;
    line-height: 1;
  }

  .btn-captain-account .captain-status-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
  }

  /* Compact Chart Mode Pill */
  .hud-mode-pill {
    padding: 2px;
    gap: 2px;
    border-radius: 20px;
  }

  .mode-pill-btn {
    padding: 4px 6px;
    font-size: 10px;
    border-radius: 14px;
    gap: 3px;
  }

  .mode-pill-btn .pill-icon {
    font-size: 11px;
  }

  /* Compact Instrument Cards */
  .hud-card {
    padding: 4px 6px;
    border-radius: 10px;
    gap: 5px;
  }

  .hud-label {
    font-size: 7.5px;
    letter-spacing: 0.3px;
  }

  .hud-value {
    font-size: 14.5px;
  }

  .hud-value.speed {
    font-size: 17.5px;
  }

  .hud-unit-badge {
    font-size: 8px;
    padding: 1px 3px;
  }

  .hud-compass-icon {
    width: 22px;
    height: 22px;
    border-width: 1px;
  }

  #hud-compass-needle {
    height: 14px;
  }

  /* Coordinates Card */
  .hud-card-coords {
    padding: 3px 8px;
    gap: 4px;
  }

  .hud-coords-text {
    font-size: 10px;
  }

  .status-badge {
    font-size: 8px;
    padding: 1px 4px;
  }

  .geohash-label {
    display: none !important;
  }

  .geohash-tag {
    font-size: 9px;
    padding: 1px 5px;
  }

  /* Dock Mobile Optimization */
  #marine-dock {
    justify-content: flex-start;
    padding: 6px 8px calc(var(--safe-bottom) + 8px);
    gap: 5px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .dock-btn {
    scroll-snap-align: start;
    min-width: 48px;
    height: 50px;
    padding: 4px 5px;
    border-radius: 10px;
  }

  .dock-btn .btn-icon {
    font-size: 16px;
  }

  .dock-btn .btn-label {
    font-size: 8px;
  }

  /* Leaflet Controls for Mobile: Positioned cleanly above dock */
  .leaflet-bottom.leaflet-right {
    bottom: calc(var(--safe-bottom) + 74px) !important;
    right: 10px !important;
  }
}

/* Narrow Smartphones (<= 380px, e.g. iPhone SE, Galaxy Z Fold cover, small Androids) */
@media (max-width: 380px) {
  #marine-hud {
    padding: calc(var(--safe-top) + 2px) 4px 3px;
    gap: 3px;
  }

  .hud-top-row {
    gap: 3px;
  }

  .hud-instruments {
    gap: 3px;
  }

  .hud-actions {
    gap: 3px;
  }

  .hud-card {
    padding: 3px 4px;
    gap: 4px;
  }

  .hud-value {
    font-size: 13px;
  }

  .hud-value.speed {
    font-size: 15px;
  }

  .hud-label {
    font-size: 6.5px;
  }

  .hud-compass-icon {
    width: 19px;
    height: 19px;
  }

  #hud-compass-needle {
    height: 12px;
  }

  .mode-pill-btn {
    padding: 3px 5px;
    font-size: 9px;
    gap: 2px;
  }

  .btn-garmin-direct,
  .btn-captain-account {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
  }

  .btn-captain-account .captain-avatar-icon {
    font-size: 13px;
  }

  .btn-garmin-direct .garmin-logo-icon {
    font-size: 12px;
  }

  .hud-card-coords {
    padding: 2px 6px;
  }

  .hud-coords-text {
    font-size: 9px;
  }

  .geohash-tag {
    font-size: 8.5px;
    padding: 1px 4px;
  }

  .status-badge {
    font-size: 7.5px;
    padding: 1px 3px;
  }

  .dock-btn {
    min-width: 44px;
    height: 46px;
    padding: 2px;
    border-radius: 8px;
  }

  .dock-btn .btn-icon {
    font-size: 15px;
  }

  .dock-btn .btn-label {
    font-size: 7.5px;
  }
}

/* ==========================================================================
   Captain Account & Authentication Styles (Google + Email)
   ========================================================================== */
.btn-captain-account {
  background: linear-gradient(135deg, rgba(20, 42, 75, 0.9) 0%, rgba(10, 25, 47, 0.9) 100%);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}

.btn-captain-account:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.btn-captain-account:active {
  transform: scale(0.96);
}

.btn-captain-account.logged-in {
  border-color: rgba(0, 255, 136, 0.5);
  background: linear-gradient(135deg, rgba(13, 60, 45, 0.85) 0%, rgba(10, 35, 30, 0.9) 100%);
}

.captain-avatar-icon {
  font-size: 13px;
  line-height: 1;
}

.captain-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: inline-block;
  transition: all 0.2s;
}

.btn-captain-account.logged-in .captain-status-dot {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 14px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 124, 195, 0.4);
}

/* Google Sign-In */
.auth-google-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.btn-google-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-google-custom:hover {
  background: #f8f9fa;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.btn-google-custom:active {
  transform: scale(0.98);
}

.google-icon {
  flex-shrink: 0;
}

/* Google Direct Card */
.google-direct-card {
  width: 100%;
  background: rgba(66, 133, 244, 0.12);
  border: 1px solid rgba(66, 133, 244, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.25s ease;
}

.google-direct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #8ab4f8;
}

.btn-mini-close-g {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
}

.btn-mini-close-g:hover {
  color: #fff;
}

.google-direct-input-row {
  display: flex;
  gap: 6px;
}

.google-direct-input-row input {
  flex: 1;
  font-size: 13px;
  padding: 8px 10px;
}

.btn-primary-google {
  background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-primary-google:hover {
  box-shadow: 0 0 12px rgba(66, 133, 244, 0.6);
  transform: translateY(-1px);
}

.btn-primary-google:active {
  transform: scale(0.96);
}

.google-direct-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 14px;
  color: var(--text-secondary);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  padding: 0 10px;
  white-space: nowrap;
}

/* Forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.auth-form.active {
  display: flex;
}

.auth-footer-links {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.btn-ghost-demo {
  background: transparent;
  border: 1px dashed rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
  padding: 8px 14px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost-demo:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
}

.btn-ghost-demo:active {
  transform: scale(0.96);
}

.auth-error-box {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: #ff7675;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
}

.auth-inline-error {
  background: rgba(255, 59, 48, 0.2);
  border: 1px solid rgba(255, 59, 48, 0.6);
  color: #ff6b6b;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 10px rgba(255, 59, 48, 0.25);
  animation: shake-error 0.3s ease;
}

@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.auth-switch-link {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-switch-link a {
  color: var(--accent-cyan);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-switch-link a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--accent-cyan);
}

.marine-input.has-error {
  border-color: #ff4757 !important;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.4) !important;
}

/* Profile Card */
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 12px;
  margin-bottom: 14px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 210, 255, 0.3);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.profile-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.auth-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-transform: uppercase;
}

.sync-badge.ok {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.btn-mini-save, .btn-mini-sync {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: var(--accent-cyan);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mini-save:hover, .btn-mini-sync:hover {
  background: rgba(0, 210, 255, 0.3);
  border-color: var(--accent-cyan);
}

.field-mini-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 3px;
}

/* Waypoint Account Ownership Banner */
.wp-account-banner {
  margin-bottom: 12px;
}

.wp-banner-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
}

.wp-banner-box.logged {
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: #d1fae5;
}

.wp-banner-box.logged .wp-banner-title {
  color: #10b981;
  font-weight: 700;
  font-size: 11.5px;
}

.wp-banner-box.guest {
  background: rgba(255, 187, 0, 0.08);
  border: 1px solid rgba(255, 187, 0, 0.35);
  color: #fef3c7;
}

.wp-banner-box.guest .wp-banner-title {
  color: #f59e0b;
  font-weight: 700;
  font-size: 11.5px;
}

.wp-banner-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.wp-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.btn-link-login-inline {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-size: 11px;
  display: inline;
}

.btn-link-login-inline:hover {
  color: #ffffff;
}

.profile-waypoint-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 2px;
}

.profile-wp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: all 0.2s;
  gap: 10px;
}

.profile-wp-item:hover {
  border-color: rgba(0, 210, 255, 0.4);
  background: rgba(0, 210, 255, 0.05);
}

.profile-wp-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.profile-wp-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-wp-coords {
  font-size: 10px;
  color: var(--text-secondary);
}

.profile-wp-stats {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-wp-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.profile-wp-focus {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #00d2ff;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-wp-focus:hover {
  background: rgba(0, 210, 255, 0.35);
  transform: translateY(-1px);
}

.profile-wp-del {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: #ff6b6b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-wp-del:hover {
  background: rgba(255, 59, 48, 0.3);
  transform: translateY(-1px);
}

.section-sub-label {
  font-size: 10px;
  color: var(--text-muted);
}

.wp-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary-compact {
  background: linear-gradient(135deg, #00f0ff 0%, #0099cc 100%);
  border: none;
  color: #050d1a;
  padding: 11px 8px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary-compact:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary-compact {
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #00d2ff;
  padding: 11px 8px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  width: 100%;
}

.btn-secondary-compact:hover {
  background: rgba(0, 210, 255, 0.25);
  border-color: rgba(0, 210, 255, 0.7);
  transform: translateY(-1px);
}

.profile-actions {
  margin-top: 14px;
}

/* ==========================================
   GPS Diagnostic Modal & Assistance
   ========================================== */
.cursor-crosshair {
  cursor: crosshair !important;
}

.gps-diag-card {
  background: rgba(14, 26, 43, 0.7);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.gps-diag-status-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.gps-diag-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.gps-diag-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gps-diag-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.gps-diag-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.gps-diag-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-val {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.gps-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.btn-action-marine {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-action-marine:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.5);
  transform: translateY(-1px);
}

.btn-action-marine .action-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.btn-action-marine .action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-action-marine .action-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.btn-action-marine .action-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.https-instruction-card {
  background: rgba(255, 187, 0, 0.06);
  border: 1px solid rgba(255, 187, 0, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.https-step {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  line-height: 1.4;
  color: #e0e8f0;
}

.https-step code {
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-yellow);
  color: #060e17;
  font-weight: 800;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Floating Banner: Modalità Posizionamento Manuale */
.floating-placement-banner {
  position: absolute;
  top: calc(var(--safe-top) + 70px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 14, 23, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: 30px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1050;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: banner-float 2s infinite ease-in-out;
}

@keyframes banner-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

.floating-placement-banner span {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.btn-cancel-placement {
  background: rgba(255, 59, 48, 0.2);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: #ff6b6b;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

