* {
      box-sizing: border-box;
    }

    #map canvas {
      pointer-events: auto;
    }

    .maplibregl-ctrl-bottom-right > * {
      margin-bottom: 8px;
      z-index: 101 !important;
    }

    .maplibregl-ctrl-group {
      border-radius: 8px !important;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
      border: 1px solid rgba(0,0,0,0.08) !important;
      overflow: hidden;
      pointer-events: auto !important;
      z-index: 1001 !important;
    }

    .maplibregl-ctrl-group button {
      width: 38px !important;
      height: 38px !important;
      border: none !important;
      background: white !important;
      transition: all 0.2s ease !important;
      pointer-events: auto !important;
    }

    .maplibregl-ctrl-group button:hover {
      background: #f8fafc !important;
    }

    .maplibregl-ctrl-group button:not(:last-child) {
      border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    }

    .map-footer {
      position: absolute;
      right: 10px;
      bottom: 8px;
      font-size: 12px;
      color: #444;
      background: rgba(255,255,255,0.8);
      padding: 2px 6px;
      border-radius: 4px;
      z-index: 1;
      user-select: none;
      font-family: 'Inter', sans-serif;
    }

    .menu-open .map-footer { 
      pointer-events: none; 
      opacity: 0;
      visibility: hidden;
    }

    body:has(.fullscreen-modal.active) .map-footer {
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
    }

    /* Hide map footer when any modal is open */
    body:has(.fullscreen-modal.active) .map-footer {
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
    }

    .maplibregl-popup-content {
      font-size: 13px;
      line-height: 1.4;
      background: transparent !important;
      border-radius: 0 !important;
      padding: 0 !important;
      color: #222;
      box-shadow: none !important;
      font-weight: 500;
      text-align: center;
      font-family: 'Inter', sans-serif;
    }

    .maplibregl-popup-tip {
      display: none !important;
    }

    /* Ensure popups work properly */
    .maplibregl-popup {
      pointer-events: auto !important;
    }

    .marine-sighting-popup .maplibregl-popup-content {
      pointer-events: auto !important;
    }

    .hamburger-menu {
      width: 40px;
      height: 40px;
      background: none;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 3px;
      margin-left: 8px;
      transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
      flex-shrink: 0;
    }

    .hamburger-menu:hover {
      background-color: rgba(60,64,67,0.08);
    }

    .hamburger-menu:active {
      background-color: rgba(60,64,67,0.12);
      transform: scale(0.95);
    }

    .hamburger-menu span {
      width: 18px;
      height: 2px;
      background: #5f6368;
      border-radius: 1px;
      transition: all 0.2s ease;
    }

    .search-container {
      position: relative;
      display: flex;
      align-items: center;
      background: #fff;
      border-radius: 32px;
      box-shadow: 0 1px 6px rgba(32,33,36,.28);
      border: 1px solid transparent;
      min-width: 400px;
      height: 56px;
      transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    }

    .search-container:hover {
      box-shadow: 0 2px 8px rgba(32,33,36,.28);
    }

    .search-container:focus-within {
      box-shadow: 0 2px 8px rgba(32,33,36,.28);
      border-color: #4285f4;
      background: #fff;
    }

    #searchInput {
      border: none;
      outline: none;
      padding: 0 20px;
      font-size: 16px;
      flex: 1;
      background: transparent;
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
      color: #202124;
      height: 100%;
      font-weight: 400;
    }

    #searchInput::placeholder {
      color: #9aa0a6;
      font-weight: 400;
    }

    .search-btn {
      background: none;
      border: none;
      padding: 16px;
      cursor: pointer;
      color: #5f6368;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      margin-right: 8px;
      transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
      flex-shrink: 0;
    }

    .search-btn:hover {
      background-color: rgba(60,64,67,0.08);
    }

    .search-btn:active {
      background-color: rgba(60,64,67,0.12);
      transform: scale(0.95);
    }

    .search-btn svg {
      width: 20px;
      height: 20px;
    }

    /* Search Results - FIXED VERSION */
    .search-results, #searchResults {
      position: absolute;
      top: calc(100% + 8px);  /* Increased gap from 4px to 8px */
      left: 0;
      right: 0;
      background: #fff;
      border-radius: 16px;  /* More rounded to match container */
      box-shadow: 0 4px 16px rgba(32,33,36,.28);  /* Consistent with container */
      border: 1px solid #dadce0;
      max-height: 320px;
      overflow-y: auto;
      display: none;
      z-index: 2000;
    }

    .search-results.visible,
    #searchResults.visible {
      display: block !important;
    }

    /* Autocomplete suggestion overlay */

    .search-autocomplete-overlay {
      position: absolute;
      left: 47px;
      top: 0;
      height: 100%;
      padding: 0 20px;
      font-size: 16px;
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
      color: #9aa0a6;
      pointer-events: none;
      display: flex;
      align-items: center;
      z-index: 1;
    }

    #searchInput {
      position: relative;
      z-index: 2;
      background: transparent;
    }

    .install-app-tooltip {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      z-index: 2000;
      pointer-events: none;
      opacity: 0;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hide on desktop - PWAs are primarily for mobile */
    @media (min-width: 769px) {
      .install-app-tooltip {
        display: none !important;
      }
    }

    .install-app-tooltip.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
      pointer-events: auto;
    }


    .install-tooltip-content {
      background: white;
      border-radius: 16px;
      box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08);
      border: 1px solid rgba(0, 0, 0, 0.06);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 280px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      font-family: 'Inter', sans-serif;
    }

    .install-tooltip-content:hover {
      transform: translateY(-2px);
      box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .install-tooltip-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      border-radius: 12px;
      color: white;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(54, 209, 220, 0.3);
    }

    .install-tooltip-text {
      flex: 1;
      min-width: 0;
    }

    .install-tooltip-title {
      font-size: 15px;
      font-weight: 600;
      color: #1e293b;
      line-height: 1.2;
      margin-bottom: 2px;
    }

    .install-tooltip-subtitle {
      font-size: 13px;
      color: #64748b;
      line-height: 1.3;
    }

    .install-tooltip-close {
      position: absolute;
      top: 8px;
      right: 8px;
      background: none;
      border: none;
      color: #9ca3af;
      cursor: pointer;
      padding: 4px;
      border-radius: 6px;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
    }

    .install-tooltip-close:hover {
      background: #f3f4f6;
      color: #6b7280;
      transform: scale(1.1);
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .install-app-tooltip {
        top: 8px !important;
        left: 16px !important;
        right: 16px !important;
        bottom: auto !important;
        transform: none !important;
      }
      
      .install-app-tooltip.show {
        transform: none !important;
      }
      
      .install-tooltip-content {
        min-width: auto;
        width: 100%;
        max-width: calc(100vw - 32px);
        padding: 14px 16px;
        border-radius: 12px;
      }
      
      .install-tooltip-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
      }
      
      .install-tooltip-title {
        font-size: 14px;
      }
      
      .install-tooltip-subtitle {
        font-size: 12px;
      }
    }

    /* Animation keyframes */
    @keyframes slideInFromRight {
      from {
        opacity: 0;
        transform: translateY(-10px) translateX(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0) translateX(0);
      }
    }

    /* Pulse effect for the install icon */
    @keyframes installPulse {
      0%, 100% {
        box-shadow: 0 2px 8px rgba(54, 209, 220, 0.3);
      }
      50% {
        box-shadow: 0 2px 8px rgba(54, 209, 220, 0.5), 0 0 0 4px rgba(54, 209, 220, 0.1);
      }
    }

    .install-tooltip-content:hover .install-tooltip-icon {
      animation: installPulse 2s ease-in-out infinite;
    }

    /* Ultra-Clean Login Modal with Your Gradient */
    .login-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 10010;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
    }

    .login-modal[style*="display: flex"],
    .login-modal[style*="display:flex"] {
        opacity: 1;
        visibility: visible;
    }

    .login-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    .login-modal-content {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 24px;
        width: 90%;
        max-width: 440px;
        padding: 56px 48px;
        box-shadow: 
            0 25px 50px -12px rgba(0, 0, 0, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
        z-index: 10011;
        position: relative;
        transform: scale(0.95);
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .login-modal[style*="display: flex"] .login-modal-content,
    .login-modal[style*="display:flex"] .login-modal-content {
        transform: scale(1);
    }

    .login-modal-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.04);
        border: none;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #6b7280;
        font-size: 26px;
        line-height: 1;
        border-radius: 50%;
        transition: all 0.2s ease;
        padding: 0;
    }

    .login-modal-close:hover {
        background: rgba(0, 0, 0, 0.08);
        color: #374151;
        transform: rotate(90deg);
    }

    .login-message {
        padding: 14px 18px;
        border-radius: 12px;
        margin-bottom: 28px;
        font-size: 14px;
        text-align: center;
        display: none;
        background: rgba(254, 243, 199, 0.9);
        color: #92400e;
        border: 1px solid rgba(251, 191, 36, 0.3);
    }

    .login-message:not(:empty) {
        display: block;
    }

    form[name="siteloklogin"] {
        padding: 0;
    }

    .login-form-group {
        margin-bottom: 18px;
    }

    .login-form-group input[type="text"],
    .login-form-group input[type="email"],
    .login-form-group input[type="password"] {
        width: 100%;
        padding: 18px 20px;
        font-size: 16px;
        border: 2px solid #e5e7eb;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.9);
        transition: all 0.2s ease;
        box-sizing: border-box;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
        color: #111827;
    }

    .login-form-group input::placeholder {
        color: #9ca3af;
    }

    .login-form-group input:hover {
        border-color: #d1d5db;
    }

    .login-form-group input:focus {
        outline: none;
        border-color: #36d1dc;
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(54, 209, 220, 0.1);
    }

    .login-submit-btn {
        width: 100%;
        padding: 18px;
        font-size: 16px;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
        border: none;
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-bottom: 0px;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
        box-shadow: 0 4px 14px rgba(54, 209, 220, 0.35);
    }

    .login-submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(54, 209, 220, 0.45);
    }

    .login-submit-btn:active {
        transform: translateY(0);
    }

    .login-form-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
    }

    .remember-checkbox {
        display: flex;
        align-items: center;
        cursor: pointer;
        color: #6b7280;
        user-select: none;
    }

    .remember-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0 8px 0 0;
        cursor: pointer;
        accent-color: #36d1dc;
    }

    .remember-checkbox span {
        font-weight: 400;
    }

    .forgot-link {
        color: #36d1dc;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .forgot-link:hover {
        color: #5b86e5;
    }

    .create-account-btn {
        display: block;
        width: 100%;
        padding: 18px;
        font-size: 16px;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
        border: none;
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
        text-decoration: none;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
        box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
        margin-bottom: 24px;
    }

    .create-account-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(6, 182, 212, 0.45);
    }

    .create-account-btn:active {
        transform: translateY(0);
    }

    /* Registration Password Requirements */
    #password-requirements {
        font-size: 12px;
        margin-top: 8px;
        line-height: 1.6;
        padding: 12px;
        background: rgba(243, 244, 246, 0.5);
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }

    #password-requirements > div {
        transition: color 0.2s ease;
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 4px 0;
    }

    #password-requirements > div::before {
        content: '';
        display: inline-block;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: currentColor;
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .login-modal-content {
            width: 92%;
            max-width: none;
            padding: 44px 32px;
            border-radius: 20px;
        }
        
        .login-form-footer {
            flex-direction: column;
            align-items: flex-start;
            gap: 14px;
        }
    }


    /* Enhanced Install Modal Styles */
    .install-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(8px);
      z-index: 10002;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .install-modal-overlay.show {
      opacity: 1;
    }

    .install-modal-overlay.closing {
      opacity: 0;
      transform: scale(0.95);
    }

    .install-modal-content {
      background: white;
      border-radius: 20px;
      width: 100%;
      max-width: 420px;
      max-height: 90vh;
      overflow: hidden;
      box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
      transform: scale(0.9) translateY(20px);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .install-modal-overlay.show .install-modal-content {
      transform: scale(1) translateY(0);
    }

    .install-modal-header {
      padding: 24px 24px 0;
      display: flex;
      align-items: flex-start;
      gap: 16px;
      position: relative;
    }

    .install-modal-icon {
      width: 48px;
      height: 48px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(54, 209, 220, 0.3);
    }

    .install-modal-title {
      font-size: 20px;
      font-weight: 700;
      color: #1e293b;
      margin: 0;
      line-height: 1.3;
      flex: 1;
      padding-top: 8px;
    }

    .install-modal-close {
      position: absolute;
      top: 0;
      right: 0;
      background: none;
      border: none;
      color: #9ca3af;
      cursor: pointer;
      padding: 8px;
      border-radius: 10px;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .install-modal-close:hover {
      background: #f3f4f6;
      color: #6b7280;
      transform: scale(1.1);
    }

    .install-modal-body {
      padding: 20px 24px;
    }

    .install-modal-instructions {
      font-size: 16px;
      color: #64748b;
      line-height: 1.6;
      margin: 0 0 24px 0;
    }

    .install-modal-steps {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .install-step {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      background: #f8fafc;
      border-radius: 12px;
      border: 1px solid #e2e8f0;
    }

    .step-number {
      width: 32px;
      height: 32px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 600;
      flex-shrink: 0;
    }

    .step-text {
      font-size: 15px;
      color: #475569;
      font-weight: 500;
    }

    .install-modal-footer {
      padding: 0 24px 24px;
      display: flex;
      justify-content: center;
      gap: 12px;
    }

    .install-modal-btn {
      flex: 1;
      padding: 14px 20px;
      border: none;
      border-radius: 12px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .install-modal-btn-secondary {
      background: #f1f5f9;
      color: #64748b;
      border: 1px solid #e2e8f0;
    }

    .install-modal-btn-secondary:hover {
      background: #e2e8f0;
      color: #475569;
      transform: translateY(-1px);
    }

    .install-modal-btn-primary {
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
      box-shadow: 0 4px 12px rgba(54, 209, 220, 0.3);
    }

    .install-modal-btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(54, 209, 220, 0.4);
    }

    /* Mobile responsive adjustments */
    @media (max-width: 480px) {
      .install-modal-overlay {
        padding: 16px;
      }
      
      .install-modal-content {
        border-radius: 16px;
        max-width: none;
      }
      
      .install-modal-header {
        padding: 20px 20px 0;
        gap: 12px;
      }
      
      .install-modal-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
      }
      
      .install-modal-title {
        font-size: 18px;
        padding-top: 6px;
      }
      
      .install-modal-body {
        padding: 16px 20px;
      }
      
      .install-modal-instructions {
        font-size: 15px;
        margin-bottom: 20px;
      }
      
      .install-step {
        padding: 14px;
        gap: 12px;
      }
      
      .step-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
      }
      
      .step-text {
        font-size: 14px;
      }
      
      .install-modal-footer {
        padding: 0 20px 20px;
        flex-direction: column;
      }
      
      .install-modal-btn {
        padding: 12px 18px;
        font-size: 15px;
      }
    }

    /* Additional styles for browser-specific steps */
.step-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

.step-icon {
  font-size: 20px;
  opacity: 0.8;
  flex-shrink: 0;
}

.install-step-fallback {
  background: #fef3f2;
  border: 1px solid #fecaca;
  text-align: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px 16px;
}

.step-icon-large {
  font-size: 32px;
  margin-bottom: 8px;
}

.step-content-centered {
  text-align: center;
}

.step-text-large {
  font-size: 16px;
  font-weight: 600;
  color: #dc2626;
  margin-bottom: 4px;
}

.step-text-small {
  font-size: 14px;
  color: #7f1d1d;
  line-height: 1.4;
}

/* Enhanced step styling for better visual hierarchy */
.install-step {
  transition: all 0.2s ease;
}

.install-step:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(54, 209, 220, 0.15);
}

.step-number {
  box-shadow: 0 2px 4px rgba(54, 209, 220, 0.2);
}

/* Animation for steps appearing */
.install-modal-steps .install-step {
  opacity: 0;
  transform: translateY(10px);
  animation: stepFadeIn 0.3s ease forwards;
}

.install-modal-steps .install-step:nth-child(1) {
  animation-delay: 0.1s;
}

.install-modal-steps .install-step:nth-child(2) {
  animation-delay: 0.2s;
}

.install-modal-steps .install-step:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes stepFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile adjustments for new elements */
@media (max-width: 480px) {
  .step-content {
    gap: 8px;
  }
  
  .step-icon {
    font-size: 18px;
  }
  
  .step-icon-large {
    font-size: 28px;
  }
  
  .install-step-fallback {
    padding: 20px 12px;
  }
  
  .step-text-large {
    font-size: 15px;
  }
  
  .step-text-small {
    font-size: 13px;
  }
}

    /* ==========================================
   SETTINGS CONTROL & PANEL
   ========================================== */

    .settings-control {
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      border: 1px solid rgba(0,0,0,0.08);
      overflow: hidden;
      width: 38px;
      margin-bottom: -3px;
      margin-right: 1px;
    }

    .settings-btn {
      width: 37px;
      height: 37px;
      background: white;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      color: #5f6368;
    }

    .settings-btn:hover {
      background: #f8fafc;
    }

    .settings-btn.active {
      background: #e5e7eb;
      color: #374151;
    }

    .settings-panel {
      position: fixed;
      bottom: 35px;
      right: 60px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
      border: 1px solid rgba(0,0,0,0.08);
      width: 300px;
      max-height: 300px;
      overflow: hidden;
      display: none;
      flex-direction: column;
      contain: layout;
  isolation: isolate;
    }

    .settings-panel.active {
      display: flex;
      pointer-events: auto;
    }

    .settings-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      border-bottom: 1px solid #e5e7eb;
    }

    .settings-header h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: #1e293b;
    }

    .settings-close {
      background: none;
      border: none;
      font-size: 24px;
      color: #64748b;
      cursor: pointer;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .settings-close:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .settings-content {
      padding: 16px;
      overflow-y: scroll;
      max-height: 450px;
    }

    .settings-section {
      margin-bottom: 20px;
    }

    .settings-section:last-child {
      margin-bottom: 0;
    }

    .settings-section-title {
      font-size: 13px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 12px;
    }

    .settings-options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .settings-option {
      padding: 10px 16px;
      background: #f8fafc;
      border: 2px solid transparent;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      color: #475569;
      transition: all 0.2s;
    }

    .settings-option:hover {
      background: #f1f5f9;
    }

    .settings-option.active {
      background: #e0f2fe;
      border-color: #0284c7;
      color: #0284c7;
    }

    .settings-toggle-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 0;
      font-size: 14px;
      color: #1e293b;
    }

    /* Toggle Switch */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
      contain: layout style paint;
  will-change: auto;
    }

    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #cbd5e1;
      border-radius: 24px;
      contain: layout style paint;
    }

    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      border-radius: 50%;
    }

    .toggle-switch input:checked + .toggle-slider {
      background-color: #0284c7;
    }

    .toggle-switch input:checked + .toggle-slider:before {
      transform: translateX(20px);
    }

    .settings-action-btn {
      width: 100%;
      padding: 12px 16px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      color: #475569;
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: center;
      transition: all 0.2s;
    }

    .settings-action-btn:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    /* ==========================================
    TOURS MODAL (PRO only)
    ========================================== */

    .tours-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        backdrop-filter: blur(4px);
    }

    .tours-modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tours-modal-content {
        background: white;
        border-radius: 12px;
        width: 90%;
        max-width: 320px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .tours-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #e2e8f0;
    }

    .tours-modal-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #1e293b;
    }

    .tours-modal-close {
        background: none;
        border: none;
        font-size: 24px;
        color: #64748b;
        cursor: pointer;
        padding: 0;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: all 0.2s;
    }

    .tours-modal-close:hover {
        background: #f1f5f9;
        color: #1e293b;
    }

    .tours-modal-body {
        padding: 16px;
    }

    .tours-modal-body .settings-action-btn {
        margin-bottom: 8px;
    }

    .tours-modal-body .settings-action-btn:last-child {
        margin-bottom: 0;
    }

    /* ==========================================
      LEGEND MODAL
      ========================================== */

    .legend-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10010;
      box-sizing: border-box;
      overflow: hidden;
    }

    .legend-modal.active {
      display: flex;
    }

    .legend-modal-content {
      background: white;
      border-radius: 12px;
      width: 90%;
      max-width: 500px;
      max-height: calc(100% - 40px);
      overflow: auto;
      display: flex;
      flex-direction: column;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      padding: 20px;
      box-sizing: border-box;
    }


    .legend-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 24px;
      border-bottom: 1px solid #e5e7eb;
    }

    .legend-modal-header h3 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
      color: #1e293b;
    }

    .legend-modal-close {
      background: none;
      border: none;
      font-size: 28px;
      color: #64748b;
      cursor: pointer;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .legend-modal-close:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .legend-modal-body {
      padding: 24px;
      overflow-y: auto;
    }

    .legend-category {
      margin-bottom: 28px;
    }

    .legend-category:last-child {
      margin-bottom: 0;
    }

    .legend-category h4 {
      margin: 0 0 16px 0;
      font-size: 14px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .legend-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px;
      border-radius: 8px;
      transition: background 0.2s;
      margin-bottom: 8px;
    }

    .legend-item:hover {
      background: #f8fafc;
    }

    .legend-item img {
      flex-shrink: 0;
      margin-top: 2px;
    }

    .legend-item-text {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .legend-item-text strong {
      font-size: 14px;
      font-weight: 600;
      color: #1e293b;
    }

    .legend-item-text span {
      font-size: 13px;
      color: #64748b;
      line-height: 1.4;
    }
      
      .legend-modal-content {
        width: 95%;
        max-height: 90vh;
      }

    /* Zoom Controls */
    .modern-nav-control {
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      border: 1px solid rgba(0,0,0,0.08);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      margin-bottom: 20px;
    }

    .modern-nav-btn {
      width: 38px;
      height: 38px;
      background: white;
      border: none;
      cursor: pointer;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      user-select: none;
      margin: 0;
      color: #5f6368;
      outline: none;
    }

    .modern-nav-btn:hover {
      background: #f8fafc;
    }

    .modern-nav-btn:active {
      background: #e5e7eb;
      transform: scale(0.98);
    }

    .modern-nav-btn:not(:last-child) {
      border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    .modern-nav-btn svg {
      display: block;
      margin: 0 auto;
    }

    /* ==========================================
      ROBUST MOBILE BOTTOM CONTROLS SOLUTION
      ========================================== */

    /* Reset and base setup */
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      width: 100%;
      background: #000;
      overflow: hidden;
      font-family: 'Inter', sans-serif;
      font-size: 14px;
    }

    .map-container {
      position: fixed;
      inset: 0;
      overflow: hidden;
      width: 100%;
      height: 100%;
      z-index: 1;
    }

    #map {
      width: 100%;
      height: 100vh !important;
      height: 100dvh !important;
      min-height: 0;
    }

    /* ==========================================
      BOTTOM CONTROLS - MOBILE FIRST APPROACH
      ========================================== */

    .map-controls {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      pointer-events: none;
      z-index: 1000;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      
      /* Base padding for desktop */
      padding: 20px;
      padding-bottom: 20px;
      
      /* Use safe area insets for mobile devices */
      padding-bottom: max(20px, env(safe-area-inset-bottom));
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
      
      /* Minimum height to prevent cramping */
      min-height: 80px;
      
      /* Ensure controls stay above bottom browser bars */
      transform: translateY(0);
    }

    /* Mobile-specific adjustments */
    @media (max-width: 768px) {
      .map-controls {
        padding-bottom: max(env(safe-area-inset-bottom), 20px);
        padding-left: max(env(safe-area-inset-left), 15px);
        padding-right: max(env(safe-area-inset-right), 15px);
        padding-top: 15px;
        min-height: 80px;
      }
    }

    /* PWA-specific styles (when running as standalone app) */
    @media (display-mode: standalone) {
      .map-controls {
        /* PWA has more predictable safe areas */
        padding-bottom: max(env(safe-area-inset-bottom), 40px);
      }
    }

    /* iPhone-specific handling */
    @supports (-webkit-touch-callout: none) {
      .map-controls {
        /* Extra padding for iOS devices */
        padding-bottom: max(env(safe-area-inset-bottom), 70px);
      }
      
      @media (max-width: 768px) and (orientation: portrait) {
        .map-controls {
          padding-bottom: max(env(safe-area-inset-bottom), 85px);
        }
      }
    }

    /* ==========================================
      CONTROL GROUPS POSITIONING
      ========================================== */

    .controls-bottom-left,
    .controls-bottom-right {
      pointer-events: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: flex-start;
      max-height: 60vh;
      overflow: visible;
      transition: none !important;
    }

    .controls-bottom-right {
      align-items: flex-end;
      position: absolute;
      bottom: 17px;
      right: 10px;
        }

    .controls-bottom-left {
      position: absolute;
      bottom: 20px;
      left: 20px;
    }

    /* ==========================================
      SEARCH CONTROLS - TOP POSITIONING
      ========================================== */

    .search-menu-controls {
      position: absolute;
      top: 20px;
      left: 20px;
      z-index: 1000;
      
      /* Safe area adjustments for top */
      top: max(20px, env(safe-area-inset-top));
      left: max(20px, env(safe-area-inset-left));
    }

    @media (max-width: 768px) {
      .search-menu-controls {
        top: max(16px, env(safe-area-inset-top));
        left: max(16px, env(safe-area-inset-left));
        right: max(16px, env(safe-area-inset-right));
      }
      
      .search-container {
        min-width: auto;
        width: 100%;
        height: 50px; /* Slightly smaller on mobile */
      }
      
      #searchInput {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0 16px;
      }
    }

    /* ==========================================
      UTILITY CLASSES FOR DEBUGGING
      ========================================== */

    /* Add this class to .map-controls for debugging */
    .debug-controls {
      background: rgba(255, 0, 0, 0.2) !important;
      border: 2px solid red !important;
    }

    /* Add this class to body for safe area visualization */
    .debug-safe-areas::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      pointer-events: none;
      z-index: 9999;
      border-top: env(safe-area-inset-top) solid rgba(0, 255, 0, 0.3);
      border-bottom: env(safe-area-inset-bottom) solid rgba(0, 255, 0, 0.3);
      border-left: env(safe-area-inset-left) solid rgba(0, 255, 0, 0.3);
      border-right: env(safe-area-inset-right) solid rgba(0, 255, 0, 0.3);
    }

    /* ==========================================
      LANDSCAPE ORIENTATION ADJUSTMENTS
      ========================================== */

    @media (max-width: 768px) and (orientation: landscape) {
      .map-controls {
        /* Reduce padding in landscape to save space */
        padding-bottom: max(env(safe-area-inset-bottom), 40px);
        min-height: 70px;
      }
      
      .search-menu-controls {
        top: max(12px, env(safe-area-inset-top));
      }
      
      .search-container {
        height: 44px; /* Smaller in landscape */
      }
    }

    /* ==========================================
      FALLBACK FOR OLDER BROWSERS
      ========================================== */

    /* Fallback for browsers that don't support env() */
    @supports not (padding: max(0px, env(safe-area-inset-bottom))) {
      @media (max-width: 768px) {
        .map-controls {
          padding-bottom: 80px; /* Fixed fallback value */
        }
        
        .search-menu-controls {
          top: 20px;
        }
      }
    }

    /* Premium Button */
    .menu-item.premium-item {
      margin-top: 20px;
      margin-bottom: 20px;
      margin-left: 16px;
      margin-right: 16px;
      border-radius: 12px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
      font-weight: 600;
      border: none;
      border-bottom: none;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      overflow: hidden; /* Contain any visual effects */
      position: relative;
    }

    .menu-item.premium-item:hover {
      background: linear-gradient(135deg, #2dd4da 0%, #4c63d2 100%);
      color: white;
      transform: translateY(-1px);
      box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    }

    /* Remove the separator line for premium item */
    .menu-item.premium-item {
      border-bottom: none;
    }

    /* Premium item shine effect */
    .menu-item.premium-item::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.5s ease;
    }

    .menu-item.premium-item:hover::before {
      left: 100%;
    }

    /* Premium icon styling */
    .menu-item.premium-item img {
      filter: brightness(0) invert(1); /* Make icon white */
    }

    /* Crown or star icon for premium */
    .premium-icon {
      position: relative;
    }

    .premium-icon::after {
      content: '👑';
      position: absolute;
      top: -2px;
      right: -2px;
      font-size: 12px;
    }

    /* Mobile responsive adjustments */
    @media (max-width: 768px) {
      .menu-item.premium-item {
        margin: 8px 12px 12px 12px;
        padding: 14px 16px;
      }
    }

    /* Subtle gradient background for the entire menu */
    .side-panel-content {
      background: linear-gradient(180deg, #fafafa 0%, #f8fafc 100%);
    }

    .side-panel {
      position: fixed;
      top: 0;
      left: -280px;
      width: 280px;
      height: 100%;
      background: white;
      box-shadow: 2px 0 12px rgba(0,0,0,0.15);
      z-index: 5000;
      transition: left 0.3s ease;
      display: flex;
      flex-direction: column;
      isolation: isolate;
    }

    .side-panel.open {
      left: 0;
      z-index: 5000; /* Ensure it stays on top when open */
    }

    .side-panel-header {
      padding: 24px 20px;
      border-bottom: 1px solid #e5e7eb;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f8fafc;
    }

    .side-panel-header h3 {
      margin: 0;
      font-size: 20px;
      font-weight: 600;
      color: #1e293b;
    }

    .close-panel {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: #64748b;
      padding: 4px;
      border-radius: 4px;
      transition: all 0.2s ease;
    }

    .close-panel:hover {
      background: #e2e8f0;
      color: #1e293b;
    }

    .side-panel-content {
      flex: 1;
      padding: 0;
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 0;
    }

    .menu-item {
      display: block;
      padding: 16px 20px;
      text-decoration: none;
      color: #374151;
      font-size: 16px;
      transition: all 0.2s ease;
      border-bottom: 1px solid #f1f5f9;
      position: relative;
    }

    .menu-item:hover {
      background: #f8fafc;
      color: #1e293b;
    }

    .side-panel-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.5);
      z-index: 1400;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease; 
    }

    .side-panel-overlay.active {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .search-result-item {
      padding: 16px 20px;
      cursor: pointer;
      border-bottom: 1px solid #f1f3f4;
      transition: background-color 0.1s cubic-bezier(0.4,0,0.2,1);
      font-size: 16px; 
      color: #202124;
      display: flex;
      align-items: center;
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif; 
      min-height: 48px;
      font-weight: 400;
}

    .search-result-item:hover {
      background-color: #f8f9fa;
    }

    .search-result-item:first-child {
      border-radius: 16px 16px 0 0;  /* Rounded top corners */
    }

    .search-result-item:last-child {
      border-bottom: none;
      border-radius: 0 0 16px 16px;  /* Rounded bottom corners */
    }

    .search-results::-webkit-scrollbar {
        width: 6px;
      }

      .search-results::-webkit-scrollbar-thumb {
        background: #dadce0;
        border-radius: 3px;
      }

      .search-results::-webkit-scrollbar-thumb:hover {
        background: #bdc1c6;
      }
      
      .side-panel {
        width: 280px;
      }
    
    /* Desktop and Tablet Menu Behavior (screens larger than 768px) */
    @media (min-width: 769px) {
      .side-panel {
        left: 0 !important; /* Menu visible by default */
        transition: left 0.3s ease;
        width: 280px;
        z-index: 5000; /* Ensure menu is above map */
      }
      
      .side-panel.closed {
        left: -280px !important; /* Hidden when closed */
      }
      
      /* No overlay needed on desktop/tablet when menu is open by default */
      .side-panel-overlay {
        display: none;
      }
      
      /* Keep map full width */
      .map-container {
        margin-left: 0 !important;
        transition: none;
      }
      
      .map-container.menu-closed {
        margin-left: 0 !important;
      }
      
      /* Push search bar right when menu is open */
      .search-menu-controls {
        margin-left: 300px; /* 280px menu + 20px gap */
        transition: margin-left 0.3s ease;
      }
      
      /* Search bar in center when menu is closed */
      .search-menu-controls.menu-closed {
        margin-left: 20px; /* Normal position */
      }
    }

    /* Drawing Controls - Premium Page */
    .custom-draw-control {
      z-index: 150;
      margin-bottom: -3px;
      margin-right: 1px;
    }

.draw-control-group {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 38px;
}

.draw-toggle-btn {
  width: 37px;
  height: 37px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
  margin: 0;
}

.draw-toggle-btn:hover {
  background: #f8fafc;
}

.draw-toggle-btn.active {
  background: #e5e7eb;
  color: #374151;
}

/* Drawing Controls Panel - positioned to the left of draw button */
.draw-controls-panel {
  position: fixed;
  bottom: 35px;
  right: 60px; /* 20px margin + 38px button + 20px gap */
  z-index: 150;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 150px;
  max-width: 150px;
}

.draw-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin: 0;
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  text-align: center;
}

.draw-btn:hover {
  background: #f1f5f9;
}

.draw-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

.measure-display {
  position: absolute;
  top: 80px;
  left: 10px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.25);
  padding: 10px 15px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  min-width: 240px;
  display: none;
}

.measure-item {
  margin: 3px 0;
  font-weight: 500;
}

.measure-label {
  color: #666;
  font-weight: 400;
}

.segment-label {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #1e293b;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  backdrop-filter: blur(16px);
  min-width: 45px;
  text-align: center;
  line-height: 1.4;
}

.segment-label .distance {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}

.segment-label .bearing {
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
  display: block;
  opacity: 0.9;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .draw-controls-panel {
    /* Keep existing positioning for the panel that pops out */
    bottom: 35px;
    right: 60px;
  }
}

    /* =========================
      POPUP STYLES - ADD THIS
      ========================= */

    .popup-header {
        background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
        color: white;
        padding: 20px;
        position: relative;
    }

    .popup-title {
        font-size: 20px;
        font-weight: 600;
        margin: 0;
        padding-right: 40px;
    }

    .popup-close {
        position: absolute;
        top: 16px;
        right: 16px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: white;
        font-size: 18px;
        transition: background 0.2s;
    }

    .popup-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .popup-content {
        padding: 0;
        max-height: calc(80vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    @media (min-width: 769px) {
        .popup-content {
            max-height: calc(55vh - 80px);
        }
    }

    .feature-grid {
        display: grid;
        gap: 0;
    }

    .feature-item {
        border-bottom: 1px solid #f0f0f0;
        padding: 16px 20px;
        transition: background 0.2s;
    }

    .feature-item:last-child {
        border-bottom: none;
    }

    .feature-item:hover {
        background: #f8f9fa;
    }

    .feature-label {
        font-weight: 600;
        color: #374151;
        margin-bottom: 4px;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .feature-value {
        color: #4b5563;
        font-size: 16px;
        line-height: 1.7;
        word-wrap: break-word;
    }

    .feature-item.long-content {
        padding: 20px;
    }

    .feature-item.long-content .feature-value {
        font-size: 16px;
        line-height: 1.7;
        word-wrap: break-word;
    }

    .popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.5s ease;
        pointer-events: none;
        backdrop-filter: blur(8px) saturate(150%); /* Stronger blur + color enhancement */
        -webkit-backdrop-filter: blur(8px) saturate(150%);
    }

    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .popup-content::-webkit-scrollbar {
        width: 6px;
    }

    .popup-content::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .popup-content::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .popup-content::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

    /* Swipe indicator for forecast graph - Modern aqua design */
    .forecast-swipe-hint {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(255, 255, 255, 0.98);
        color: #1d1d1f;
        padding: 18px 28px;
        border-radius: 32px;
        display: flex;
        align-items: center;
        gap: 16px;
        font-size: 16px;
        font-weight: 600;
        pointer-events: none;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        animation: fadeInOut 1.5s ease-in-out forwards;
    }

    .forecast-swipe-hint::before,
    .forecast-swipe-hint::after {
        font-size: 28px;
        line-height: 1;
    }

    .forecast-swipe-hint::before {
        content: '👈';
    }

    .forecast-swipe-hint::after {
        content: '👉';
    }

    @keyframes fadeInOut {
        0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
        15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    }

    @media (min-width: 769px) {
        .forecast-swipe-hint {
            display: none;
        }
    }

    /* Modern button styles */
    .modern-btn {
    background: linear-gradient(135deg, #FF9A8B 0%, #FFB38A 100%);
    box-shadow: 0 2px 8px rgba(255, 154, 86, 0.3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    .modern-btn-small {
    padding: 6px 12px;
    font-size: 13px;
    }

    /* Top Right Menu */
    .top-menu {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 1000;
      display: flex;
      align-items: center;
      gap: 4px;
      background: linear-gradient(135deg, rgba(79, 217, 220, 0.95) 0%, rgba(79, 217, 220, 0.85) 100%);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-radius: 20px;
      padding: 6px 12px;
      box-shadow: 0 4px 16px rgba(79, 217, 220, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.3);
      transition: all 0.3s ease;
    }

    .top-menu:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(79, 217, 220, 0.35);
    }

    .menu-btn {
      background: none;
      border: none;
      color: white;
      padding: 8px 12px;
      border-radius: 16px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 14px;
      font-weight: 600;
      font-family: 'Inter', sans-serif;
    }

    .menu-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.02);
    }

    .menu-icon {
      font-size: 16px;
    }

    .menu-label {
      font-size: 13px;
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .top-menu {
        padding: 4px 8px;
        gap: 2px;
      }
      
      .menu-btn {
        padding: 6px 8px;
        gap: 4px;
      }
      
      .menu-label {
        display: none;
      }
      
      .menu-icon {
        font-size: 18px;
      }
    }

    /* Message delete styling */
    .message-actions {
      font-size: 11px;
      color: #94a3b8;
      margin-left: 8px;
    }

    .message-actions a {
      color: #94a3b8;
      text-decoration: none;
      cursor: pointer;
    }

    .message-actions a:hover {
      color: #ef4444;
      text-decoration: underline;
    }

    /* Site Popup Tabs - Matches Viz Predictions Modal Style */
.site-popup-tabs {
    display: flex;
    gap: 0;
    background: #ffffff;
    padding: 0 32px;
    border-bottom: 1px solid #e5e7eb;
}

.site-popup-tab {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.site-popup-tab:hover {
    color: #1e293b;
}

.site-popup-tab.active {
    color: #1e293b;
    border-bottom-color: #3b82f6;
}

    /* iOS-style subtle animation */
    .site-popup-tab:active {
        transform: scale(0.98);
    }

    /* Site Tab Content */
    .site-tab-content {
        display: none;
        animation: fadeIn 0.2s ease-in;
    }

    .site-tab-content.active {
        display: block;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Consistent modal body height for site popup */
    #feature-popup .modal-body {
        min-height: 60vh;
        max-height: 75vh;
        overflow-y: auto;
    }

    /* Conditions Breakdown Section */
    #conditions-breakdown-section {
        padding: 20px;
        background: #f9fafb;
        border-radius: 8px;
        margin-top: 20px;
    }

    /* Site Reports Feed */
    #site-reports-feed {
        padding: 20px;
    }

    /* Shimmer loading animation */
    .shimmer-line {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
        border-radius: 4px;
        display: inline-block;
    }

    @keyframes shimmer {
        0% { background-position: -200% 0; }
        100% { background-position: 200% 0; }
    }

    .condition-stat.shimmer {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
    }

    /* Latest conditions in popup */
    .latest-conditions-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid #e0f2fe;
    }

    #latest-condition-display {
        min-height: 90px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .conditions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    }

    .conditions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    font-size: 13px;
    }

    .condition-stat {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .condition-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
    }

    .condition-value {
    font-size: 16px;
    font-weight: bold;
    color: #1e40af;
    }

   /* Universal condition colors - Keep existing colors, fix yellow and orange text */
.swell-low,
.visibility-good,
.temp-hot,
.condition-stat.swell-low,
.condition-stat.visibility-good,
.condition-stat.temp-hot { 
  background-color: #e6f4ea !important; 
  color: #137333 !important;  /* Keep existing green */
}

.swell-medium,
.visibility-fair,
.temp-warm,
.condition-stat.swell-medium,
.condition-stat.visibility-fair,
.condition-stat.temp-warm { 
  background-color: #fefce8 !important; 
  color: #ca8a04 !important;  /* More yellow, less brown */
}

.swell-high,
.visibility-limited,
.temp-cool,
.condition-stat.swell-high,
.condition-stat.visibility-limited,
.condition-stat.temp-cool { 
  background-color: #fef2e2 !important; 
  color: #ea580c !important;  /* More orange, less red */
}

.swell-extreme,
.visibility-poor,
.temp-cold,
.condition-stat.swell-extreme,
.condition-stat.visibility-poor,
.condition-stat.temp-cold { 
  background-color: #fce8e6 !important; 
  color: #d93025 !important;  /* Keep existing red */
}

/* Popup specific text color overrides */
.condition-stat.swell-low .condition-value,
.condition-stat.visibility-good .condition-value,
.condition-stat.temp-hot .condition-value { color: #137333 !important; }

.condition-stat.swell-medium .condition-value,
.condition-stat.visibility-fair .condition-value,
.condition-stat.temp-warm .condition-value { color: #ca8a04 !important; }

.condition-stat.swell-high .condition-value,
.condition-stat.visibility-limited .condition-value,
.condition-stat.temp-cool .condition-value { color: #ea580c !important; }

.condition-stat.swell-extreme .condition-value,
.condition-stat.visibility-poor .condition-value,
.condition-stat.temp-cold .condition-value { color: #d93025 !important; }

    /* Mobile */
    @media (max-width: 768px) {
      .fullscreen-modal .modal-header .modal-title {
        font-size: 16px !important;
      }
    }

    #report-sighting-modal {
      z-index: 10020;
    }
    #report-sighting-modal .modal-content {
      z-index: 10021;
    }

    /* Fullscreen modals - Add to these 3 lists to have standard clean fullscreen modal */
    @media (max-width: 768px) {
      #marine-life-modal .modal-content,
      #report-sighting-modal .modal-content,
      #conditions-feed-modal .modal-content,
      #report-modal .modal-content,
      #log-dive-modal .modal-content,
      #confirmation-modal .modal-content,
      #vizPredictionsModal .modal-content,
      #vizModal .viz-modal-content,
      #changelog-modal .modal-content,
      #feature-popup .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
      }
      
      /* Modal headers stay fixed */
      #marine-life-modal .modal-header,
      #report-sighting-modal .modal-header,
      #conditions-feed-modal .modal-header,
      #report-modal .modal-header,
      #log-dive-modal .modal-header,
      #changelog-modal .modal-header,
      #confirmation-modal .modal-header {
        flex-shrink: 0 !important;
      }
      
      /* Modal bodies expand to fill space */
      #marine-life-modal .modal-body,
      #report-sighting-modal .modal-body,
      #conditions-feed-modal .modal-body,
      #report-modal .modal-body,
      #log-dive-modal .modal-body,
      #changelog-modal .modal-body,
      #confirmation-modal .modal-body {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch !important;
      }
    }

    /* Mobile: Stack conditions and vis top row cards vertically */
    @media (max-width: 768px) {
      #overview-top-row,
      #conditions-top-row {
        grid-template-columns: 1fr !important;
      }
    }

    #report-sighting-modal {
      z-index: 10020;
    }
    #report-sighting-modal .modal-content {
      z-index: 10021;
    }

    /* Full screen modal */
    .fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    }

    .fullscreen-modal.active {
    opacity: 1;
    visibility: visible;
    }

    .modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateY(30px);
    transition: transform 0.3s ease;
    z-index: 10011;
    position: relative;
    }

    .fullscreen-modal.active .modal-content {
    transform: translateY(0);
    }

    .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px 16px 0 0;
    }

    /* Remove modal header rounded corners on mobile */
    @media (max-width: 768px) {
        .modal-header {
            border-radius: 0 !important;
        }
    }

    .modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
    }

    .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    }

    .close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    }

    .modal-body {
    padding: 32px;
    }

    /* Hide rating card on mobile */
    @media (max-width: 768px) {
      .rating-card {
        display: none !important;
      }
    }

    /* ANIMATED PULSING DOT IN SOME HEADERS (LIVE PULSE) */

    /* Modal title base */
    .fullscreen-modal .modal-header .modal-title {
      font-size: 18px !important;
      font-weight: 600;
      position: relative;
      padding-left: 0;
    }

    /* Mobile */
    @media (max-width: 768px) {
      .fullscreen-modal .modal-header .modal-title {
        font-size: 16px !important;
      }
    }

    /* Green beacon — live conditions data */
    @keyframes beacon {
      0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
      50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    }

    #conditions-feed-modal .modal-header .modal-title {
      padding-left: 20px;
    }

    #conditions-feed-modal .modal-header .modal-title::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 8px;
      height: 8px;
      background: #10b981;
      border-radius: 50%;
      animation: beacon 2s ease-in-out infinite;
    }

    /* Blue beacon — live marine sightings */
    @keyframes beacon-blue {
      0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
      50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    }

    #marine-life-modal .modal-header .modal-title {
      padding-left: 20px;
    }

    #marine-life-modal .modal-header .modal-title::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 8px;
      height: 8px;
      background: #3b82f6;
      border-radius: 50%;
      animation: beacon-blue 2s ease-in-out infinite;
    }

    /* ========================================
   FORECAST MODAL STYLING
   ======================================== */

.fullscreen-modal.modal-style-forecast .modal-content {
  max-width: 1400px;
  width: 95%;
  background: #ffffff;
}

.fullscreen-modal.modal-style-forecast .modal-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
  padding: 28px 32px 24px;
  border-bottom: none;
  position: relative;
  overflow: hidden;
}

/* Subtle wave effect overlay on header */
.fullscreen-modal.modal-style-forecast .modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.05) 50%, 
    transparent 100%);
  pointer-events: none;
}

.fullscreen-modal.modal-style-forecast .modal-title {
  color: #ffffff;
  font-size: 33px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fullscreen-modal.modal-style-forecast .close-btn {
  color: #ffffff;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  font-size: 28px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.fullscreen-modal.modal-style-forecast .close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.fullscreen-modal.modal-style-forecast .modal-body {
  padding: 30px;
}

@media (max-width: 768px) {
  .fullscreen-modal.modal-style-forecast {
    align-items: flex-start;
  }
  .fullscreen-modal.modal-style-forecast .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    max-height: 100%;
  }
  
  .fullscreen-modal.modal-style-forecast .modal-header {
    padding: 20px 24px;
  }
  
  .fullscreen-modal.modal-style-forecast .modal-title {
    font-size: 24px;
  }
  
  .fullscreen-modal.modal-style-forecast .modal-body {
    padding: 20px;
  }
}

    /* Forecast Modal - Wider for graphs */
    .forecast-modal-content {
        max-width: 1400px !important;
        width: 95% !important;
    }

    @media (max-width: 768px) {
        .forecast-modal-content {
            width: 100% !important;
            max-width: 100% !important;
            border-radius: 0 !important;
            max-height: 100% !important;
        }
    }

    /* Hide scrollbars in forecast canvas container */
    .canvas-container::-webkit-scrollbar {
        display: none;
    }

    .canvas-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* About Modal */
    .about-modal-content {
      max-width: 600px;
    }

    .about-modal-body {
      padding: 32px;
      text-align: center;
      background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }

    .about-logo-section {
      margin-bottom: 16px;
    }

    .about-logo {
      width: 140px;
      height: auto;
      object-fit: contain;
      filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    }

    .about-version-info {
      font-size: 14px;
      color: #64748b;
      margin-bottom: 32px;
      font-weight: 500;
    }

    .about-description {
      font-size: 18px;
      line-height: 1.6;
      color: #1e293b;
      margin-bottom: 40px;
      max-width: 480px;
      margin-left: auto;
      margin-right: auto;
    }

    .about-credits {
      border-top: 1px solid #e2e8f0;
      padding-top: 32px;
      margin-top: 32px;
    }

    .credits-section {
      margin-bottom: 24px;
    }

    .credits-section:last-child {
      margin-bottom: 0;
    }

    .credits-section h4 {
      font-size: 16px;
      font-weight: 600;
      color: #36d1dc;
      margin: 0 0 8px 0;
    }

    .credits-section p {
      font-size: 14px;
      line-height: 1.5;
      color: #64748b;
      margin: 0;
    }

    /* Mobile responsiveness for about modal */
    @media (max-width: 768px) {
      .about-modal-body {
        padding: 24px;
      }
      
      .about-logo {
        width: 120px;
      }
      
      .about-description {
        font-size: 16px;
      }
    }

    /* Fix marine sighting marker positioning and hover */
    .maplibregl-marker {
      transform-origin: center center !important;
      pointer-events: auto !important;
      /* Remove any transform animations that cause flickering */
      transition: none !important;
    }

    .maplibregl-marker img {
      transform-origin: center center !important;
      pointer-events: auto !important;
      user-select: none !important;
      -webkit-user-drag: none !important;
      -webkit-user-select: none !important;
      -moz-user-select: none !important;
      -ms-user-select: none !important;
      display: block !important;
      position: relative !important;
      /* Prevent any hover transforms that cause flickering */
      transition: none !important;
    }

    /* Additional fixes for marker stability */
    .maplibregl-marker .marine-sighting-marker {
      pointer-events: auto !important;
      position: relative !important;
      z-index: 50 !important;
      /* Prevent any unwanted transforms */
      transform: none !important;
      transition: none !important;
    }

    /* If you have custom marker elements, ensure they're stable */
    .marine-marker-icon {
      pointer-events: auto !important;
      transition: none !important;
      transform: none !important;
      backface-visibility: hidden !important;
      -webkit-backface-visibility: hidden !important;
    }

    /* Marine life beacon cursor - override all conflicts */
    .maplibregl-marker[data-marine-life] {
      cursor: pointer !important;
    }

    .maplibregl-marker[data-marine-life] * {
      cursor: pointer !important;
    }

    /* Target the pulsing beacon specifically */
    .maplibregl-marker div[style*="pulsing-dot"] {
      cursor: pointer !important;
    }

    /* Additional backup selectors */
    .maplibregl-marker:has([style*="pulsing-dot"]) {
      cursor: pointer !important;
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .sightings-header {
        justify-content: center; /* Center the button on mobile */
        margin-bottom: 20px;
      }
      
      #report-sighting-btn {
        width: 100%; /* Full width on mobile like upgrade button */
        max-width: 300px;
        justify-content: center;
        padding: 16px 24px;
      }
    }

    /* Marine Life Sightings Styles */
    .sightings-header {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e5e7eb;
    }

    #sightings-list {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    /* Enhanced Sighting Card Layout */
    .sighting-card {
      background: white;
      border: 1px solid #e5e7eb;
      border-radius: 16px; /* More rounded for modern look */
      padding: 20px;
      transition: all 0.2s ease;
      box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* Softer shadow */
      transform-style: preserve-3d;
      position: relative;
      overflow: hidden;
    }

    .sighting-card:hover {
      box-shadow: 0 8px 24px rgba(0,0,0,0.12); /* Enhanced hover shadow */
      transform: translateY(-4px); /* More pronounced lift */
      border-color: #36d1dc;
      isolation: isolate;
    }

    /* Add a subtle left border for visual interest */
    .sighting-card::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 4px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      border-radius: 0 2px 2px 0;
    }

    /* Add click indicator */
    .sighting-card {
      cursor: pointer;
    }

    .sighting-card::after {
      content: '👁️ View on Map';
      position: absolute;
      bottom: 12px;
      right: 16px;
      font-size: 12px;
      color: #64748b;
      opacity: 0;
      transition: opacity 0.2s ease;
      pointer-events: none;
    }

    .sighting-card:hover::after {
      opacity: 1;
    }

    .sighting-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 16px; /* Increased spacing */
    }

    .species-info {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      flex: 1;
    }

    /* Enhanced species display */
    .species-details h3 {
      margin: 0 0 6px 0;
      font-size: 20px; /* Slightly larger */
      font-weight: 700; /* Bolder */
      color: #1e293b;
      line-height: 1.2;
    }

    .species-count {
      font-size: 14px;
      color: #64748b;
      background: #f1f5f9;
      padding: 4px 10px;
      border-radius: 12px;
      font-weight: 500;
      display: inline-block;
    }

    /* Better time and status display */
    .sighting-time {
      text-align: right;
      font-size: 13px;
      color: #64748b;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
    }

    /* Enhanced location display */
    .sighting-location {
      font-weight: 600;
      color: #374151;
      margin-bottom: 12px;
      padding: 8px 12px;
      background: #f8fafc;
      border-radius: 8px;
      border-left: 3px solid #36d1dc;
      font-size: 14px;
    }

    /* Better notes styling */
    .sighting-notes {
      color: #4b5563;
      line-height: 1.6;
      margin-bottom: 16px;
      font-style: italic;
      padding: 12px;
      background: #fafafa;
      border-radius: 8px;
      border-left: 3px solid #e5e7eb;
    }

    /* Enhanced photo display */
    .sighting-photo {
      width: 100%;
      max-width: 100%;
      height: 220px; /* Fixed height for consistency */
      object-fit: cover;
      border-radius: 12px;
      margin-top: 16px;
      cursor: pointer;
      transition: all 0.3s ease;
      will-change: transform;
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .sighting-photo:hover {
      transform: scale(1.02);
      box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

    .empty-sightings {
      text-align: center;
      padding: 60px 20px;
      color: #64748b;
    }

    .empty-sightings-icon {
      font-size: 64px;
      margin-bottom: 16px;
      opacity: 0.5;
    }

    /* Mobile responsive improvements */
    @media (max-width: 768px) {
      .sighting-header {
        flex-direction: column;
        gap: 12px;
      }
      
      .species-info {
        flex-direction: column;
        text-align: left;
        gap: 8px;
      }
      
      .sighting-time {
        text-align: left;
        align-items: flex-start;
      }
      
      .species-details h3 {
        font-size: 18px;
      }
      
      .sighting-photo {
        height: 180px;
      }
      
      .sighting-card::after {
        display: none; /* Hide "View on Map" text on mobile */
      }
    }

    /* Report Sighting Modal Styles */
.photo-upload-area {
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.photo-upload-area:hover {
  border-color: #36d1dc;
  background: #f0fdff;
}

.photo-upload-area.drag-over {
  border-color: #36d1dc;
  background: #e0f9ff;
  transform: scale(1.02);
}

.upload-placeholder {
  pointer-events: none;
}

.photo-preview {
  position: relative;
}

.remove-photo-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-photo-btn:hover {
  background: rgba(239, 68, 68, 1);
}

#other-species-group {
  transition: all 0.3s ease;
}

#other-species-group.show {
  display: block !important;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 100px;
    margin-bottom: 24px;
  }
}

/* Location picker map styling */
#location-picker-map {
  position: relative;
  cursor: crosshair;
}

#location-picker-map .maplibregl-canvas {
  cursor: crosshair !important;
}

/* Form improvements */
.form-grid input[type="date"],
.form-grid input[type="time"] {
  font-family: inherit;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  
  #location-picker-map {
    height: 200px !important;
  }
  
  .photo-upload-area {
    padding: 16px;
  }
}

/* Make the report sighting button larger and more prominent */
#report-sighting-btn {
  background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
  color: white;
  border: none;
  padding: 14px 24px; /* Increased from 6px 12px */
  border-radius: 12px; /* Increased border radius */
  font-size: 16px; /* Increased from 12px */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(54, 209, 220, 0.3);
  display: flex;
  align-items: center;
  gap: 8px; /* Increased gap */
  min-height: 48px; /* Ensure good touch target */
}

#report-sighting-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 209, 220, 0.4);
  background: linear-gradient(135deg, #2dd4da 0%, #4c63d2 100%);
}

/* Marine Sighting Popup Styles */
.maplibregl-popup.marine-sighting-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border: none;
  pointer-events: auto !important;
}

.maplibregl-popup.marine-sighting-popup .maplibregl-popup-tip {
  border-top-color: white;
}

@keyframes pulsing-dot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

.marine-sighting-marker {
  transform-origin: center center !important;
  pointer-events: auto !important;
  transition: none !important;
  position: relative !important;
  z-index: 50 !important;
}

/* Success notification animation */
@keyframes slideInRight {
  from { 
    transform: translateX(100%); 
    opacity: 0; 
  }
  to { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

    /* Species Autocomplete Styles */
    .species-autocomplete-container {
      position: relative;
    }

    .species-suggestions {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: white;
      border: 1px solid #e5e7eb;
      border-top: none;
      border-radius: 0 0 8px 8px;
      max-height: 200px;
      overflow-y: auto;
      z-index: 1000;
      display: none;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .species-suggestion {
      padding: 12px 16px;
      cursor: pointer;
      border-bottom: 1px solid #f1f5f9;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: background 0.2s ease;
    }

    .species-suggestion:hover,
    .species-suggestion.highlighted {
      background: #f8fafc;
    }

    .species-suggestion:last-child {
      border-bottom: none;
    }

    .species-name {
      font-weight: 500;
      color: #1e293b;
    }

    .species-common {
      font-size: 12px;
      color: #64748b;
      margin-left: auto;
    }

    /* Input focus state */
    #species-input:focus + .species-suggestions {
      display: block;
    }

    .species-autocomplete-container:focus-within .species-suggestions {
      display: block;
    }

    /* Enhanced map status badges */
    .map-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .map-status.active {
      background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
      color: #166534;
      border: 1px solid #86efac;
    }

    .map-status.expired {
      background: #f3f4f6;
      color: #6b7280;
      border: 1px solid #d1d5db;
    }

    /* Form styles — scoped to prevent bleed into login modal */
    #log-dive-form .form-grid,
    #marine-sighting-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    }

    #log-dive-form .form-group,
    #marine-sighting-form .form-group {
    display: flex;
    flex-direction: column;
    }

    #log-dive-form .form-label,
    #marine-sighting-form .form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    }

    #log-dive-form .form-input,
    #marine-sighting-form .form-input {
    height: 42px;
    padding: 0 14px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #f1f5f9;
    outline: none;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    }

    .form-input:hover {
    background: #e8eef5;
    }

    .form-input:focus {
    outline: none;
    background: white;
    border-color: #e2e8f0;
    box-shadow: none;
    }

    .form-input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
    }

    textarea.form-input {
    height: auto;
    padding: 12px 14px;
    border-radius: 12px;
    }

    select.form-input {
    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='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #f1f5f9;
    padding-right: 34px;
    cursor: pointer;
    }

    select.form-input:focus {
    background-color: white;
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
    }

    .form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
    }

    /* Modern Google-like Conditions Feed Styling */

/* Modal Header - Clean and Minimal */
.conditions-feed-modal .modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e8eaed;
  background: white;
}

.conditions-feed-modal .modal-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin: 0;
  letter-spacing: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Close button - Google style */
.conditions-feed-modal .close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #5f6368;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.conditions-feed-modal .close-btn:hover {
  background-color: #f1f3f4;
}

/* Table Container */
#conditions-table-container {
  padding: 0;
  background: white;
}

/* Modern Clean Table */
.conditions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: white;
  border-radius: 0;
  box-shadow: none;
  border: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Table Headers - Google style */
.conditions-table th {
  background: white;
  color: #5f6368;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0.25px;
  border-bottom: 1px solid #e8eaed;
  position: sticky;
  top: 0;
  z-index: 10;
  line-height: 1.4;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dive Site column - narrower */
.conditions-table th:nth-child(1) {
  width: 140px;
  padding-left: 17px;
}

/* Center specific headers */
.conditions-table th:nth-child(2), /* When */
.conditions-table th:nth-child(3), /* Swell */
.conditions-table th:nth-child(4), /* Visibility */
.conditions-table th:nth-child(5), /* Water Temp */
.conditions-table th:nth-child(6)  /* Region */ {
  text-align: center;
}

/* Table Cells */
.conditions-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
  transition: background-color 0.15s ease;
  font-size: 16px;
  line-height: 1.4;
}

/* Row Hover - Subtle Google style */
.conditions-table tr:hover {
  background-color: #f8f9fa;
}

/* Column-specific styling */
.site-name-col {
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 17px;
}

.timestamp-col {
  color: #5f6368;
  font-size: 13px;
  white-space: nowrap;
  text-align: center;
  min-width: 80px;
}

.swell-col, .visibility-col, .temp-col {
  text-align: center;
  font-weight: 500;
  color: #202124;
  min-width: 170px;    /* Same width for all three */
  max-width: 170px;    /* Force exact width */
  width: 170px;        /* Ensure consistency */
}

.region-col {
  color: #5f6368;
  text-align: center;
  font-size: 13px;
  min-width: 100px;
}

/* Empty State - Google style */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #5f6368;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 14px;
  color: #5f6368;
  margin: 0;
}

/* Loading State - Google style */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: #5f6368;
}

.loading-spinner {
  font-size: 24px;
  margin-bottom: 16px;
  animation: spin 1s linear infinite;
}

.loading-state p {
  font-size: 14px;
  color: #5f6368;
  margin: 0;
}

/* Mobile Responsive - Clean and Readable */
@media (max-width: 768px) {
  .conditions-feed-modal .modal-title {
    font-size: 16px;
  }
  
  .conditions-feed-modal .modal-header {
    padding: 12px 16px;
  }
  
  .conditions-table {
    font-size: 12px;
    border-spacing: 0 1px;
  }
  
  .conditions-table th {
    padding: 8px 6px;
    font-size: 16px;
    font-weight: 600;
  }
  
  .conditions-table td {
    padding: 8px 6px;
    font-size: 15px;
  }
  
  .site-name-col {
  max-width: 50px;
  font-size: 16px;
  padding-left: 17px !important;
}

.timestamp-col {
  font-size: 16px;
  min-width: 65px;
}

.swell-col, .visibility-col, .temp-col {
  font-size: 15px;
  min-width: 70px;    /* Keep mobile width the same */
  max-width: 70px;
  width: 70px;
}

/* Mobile header text overrides */
.conditions-table th:nth-child(3)::after {
  content: "Viz"; 
}

.conditions-table th:nth-child(4)::after {
  content: "Swell"; 
}

.conditions-table th:nth-child(5)::after {
  content: "Temp";  
}

.conditions-table th:nth-child(3),
.conditions-table th:nth-child(4),
.conditions-table th:nth-child(5) {
  font-size: 0;
}

.conditions-table th:nth-child(3)::after,
.conditions-table th:nth-child(4)::after,
.conditions-table th:nth-child(5)::after {
  font-size: 16px;
}
  
  /* Condition badges on mobile */
  .swell-low, .swell-medium, .swell-high, .swell-extreme,
  .visibility-poor, .visibility-limited, .visibility-fair, .visibility-good,
  .temp-cold, .temp-cool, .temp-warm, .temp-hot {
    padding: 2px 6px;
    font-size: 10px;
  }
  
  /* Hide region column on mobile */
  .conditions-table th:nth-child(6),
  .conditions-table td:nth-child(6) {
    display: none;
  }

  /* Center the text in headers with icons */
  .conditions-table th:nth-child(3), /* Viz */
  .conditions-table th:nth-child(4), /* Swell */
  .conditions-table th:nth-child(5)  /* Temp */ {
    text-align: center;
  }
  
  /* Make header icons smaller on mobile */
  .conditions-table th img {
    width: 17px !important;
    height: 17px !important;
    margin: 0 auto 4px auto !important;
    display: block;
  }
}

    .site-action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

    .site-action-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        color: #475569;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .site-action-btn:hover {
        background: #e2e8f0;
        color: #1e293b;
        border-color: #cbd5e1;
    }

    .site-action-btn-share {
        color: #059669;
        border-color: #a7f3d0;
        background: #f0fdf4;
    }

    .site-action-btn-share:hover {
        background: #dcfce7;
        border-color: #6ee7b7;
    }

    .conditions-buttons {
        display: flex;
        gap: 8px;
        align-items: stretch;
    }

    .conditions-buttons button {
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Layer Management */

    #map {
      pointer-events: auto !important;
    }

    .maplibregl-canvas {
      pointer-events: auto !important;
    }

    .maplibregl-control-container * {
      pointer-events: auto !important;
      z-index: 100 !important;
    }

    .draw-toggle-btn {
      position: relative !important;
      z-index: 10000 !important;
      pointer-events: auto !important;
    }

    .custom-draw-control {
      z-index: 150 !important;
      pointer-events: auto !important;
    }


    .draw-controls-panel, .draw-controls-panel * {
      pointer-events: auto !important;
      z-index: 150 !important;
    }

    .draw-btn {
      pointer-events: auto !important;
      position: relative !important;
      z-index: 201 !important;
    }

    /* Settings control pointer events */
    .settings-control,
    .settings-control * {
      pointer-events: auto !important;
      z-index: 10000 !important;
    }

    .settings-btn {
      pointer-events: auto !important;
      z-index: 10001 !important;
    }

    /* Settings panel pointer events */
    .settings-panel,
    .settings-panel * {
      pointer-events: auto !important;
      z-index: 10007 !important;
    }

    /* Settings panel buttons - ensure they're clickable */
    .settings-option,
    .settings-action-btn,
    .toggle-switch,
    .settings-close {
      pointer-events: auto !important;
      position: relative;
      z-index: 10004 !important;
    }

    /* Make sure content area is also interactive */
    .settings-content {
      pointer-events: auto !important;
      z-index: 10003 !important;
    }

    .live-weather-box {
      position: absolute;
      top: 30px;
      right: 30px;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 12px;
      padding: 12px 16px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
      z-index: 100;
      min-width: 320px;
      max-width: 500px;
      transition: none !important;
    }

    .live-weather-box.hidden {
      display: none;
    }

    .live-weather-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid #e5e7eb;
    }

    .live-weather-location {
      font-weight: 600;
      color: #1e293b;
      font-size: 14px;
    }

    .live-weather-period {
      font-size: 11px;
      color: #64748b;
      margin-left: 8px;
    }

    .confidence-icon {
      width: 12px;
      height: 12px;
      display: inline-block;
      vertical-align: middle;
      margin-right: 3px;
    }

    .live-weather-close {
      background: none;
      border: none;
      font-size: 20px;
      color: #64748b;
      cursor: pointer;
      padding: 0;
      width: 24px;
      height: 24px;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .live-weather-close:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .live-weather-data {
      display: flex;
      gap: 16px;
      justify-content: space-between;
      padding: 0 22px;
    }

    /* Live Weather Item with color indicator */
    .live-weather-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }

    .live-weather-value-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding-left: 16px;
      position: relative;
      min-width: 50px;
    }
    
    .live-weather-value-group::before {
      content: '';
      position: absolute;
      left: 0px;
      top: 2px;
      bottom: 2px;
      width: 7px;
      background-color: transparent;
      border-radius: 4px;
      transition: background-color 0.3s;
    }

    /* Widget-specific visibility colors (border only) */
    .live-weather-item.widget-visibility-good .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-visibility-fair .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-visibility-limited .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-visibility-poor .live-weather-value-group::before { background-color: #ee5a6f; }

    /* Widget-specific swell colors (border only) */
    .live-weather-item.widget-swell-low .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-swell-medium .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-swell-high .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-swell-extreme .live-weather-value-group::before { background-color: #ee5a6f; }

    /* Widget-specific wind colors (border only) */
    .live-weather-item.widget-wind-calm .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-wind-light .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-wind-moderate .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-wind-strong .live-weather-value-group::before { background-color: #ee5a6f; }

    /* Widget-specific temp colors (border only) */
    .live-weather-item.widget-temp-hot .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-temp-warm .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-temp-cool .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-temp-cold .live-weather-value-group::before { background-color: #3b82f6; }

    .live-weather-icon {
      width: 20px;
      height: 20px;
      object-fit: contain;
      margin-bottom: 6px;
      margin-left: 3px;
    }

    .live-weather-value {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

    .live-weather-unit {
      font-size: 11px;
      margin-left: -10px;
      color: #64748b;
    }

    .trend-arrow {
      font-size: 14px;
      font-weight: 900;
      display: inline-block;
      -webkit-text-stroke: 0.2px currentColor;
      text-stroke: 0.2px currentColor;
    }

    .trend-arrow.trend-up-good {
        color: #16a34a;
    }

    .trend-arrow.trend-down-good {
        color: #16a34a;
    }

    .trend-arrow.trend-up-bad {
        color: #f97316;
    }

    .trend-arrow.trend-down-bad {
        color: #f97316;
    }

    .trend-arrow.trend-neutral {
        color: #94a3b8;
    }

    .live-weather-label {
      font-size: 11px;
      color: #64748b;
      font-weight: 600;
      text-align: center;
      width: 100%;
      padding-left: 8px;
    }

    .value-with-trend {
    display: flex;
    align-items: center;
    gap: 3px;
}

    .live-weather-warning {
      display: none;
    }

    .weather-alert-ticker {
      display: inline-flex;
      align-items: center;
      min-width: 0;
      overflow: hidden;
    }

    .weather-alert-count-pill {
      display: inline-flex;
      align-items: center;
      padding: 4px 11px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 600;
      white-space: nowrap;
      background: #fff7ed;
      border: 1px solid #f97316;
      color: #c2410c;
      cursor: pointer;
      transition: background 0.2s;
    }

    .weather-alert-count-pill:hover {
      background: #ffedd5;
    }

    /* Weather Warnings Modal */
    .weather-warnings-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.4);
      z-index: 10010;
      align-items: center;
      justify-content: center;
    }

    .weather-warnings-modal.active {
      display: flex;
    }

    .weather-warnings-content {
      background: white;
      border-radius: 16px;
      width: 90%;
      max-width: 420px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.18);
      overflow: hidden;
    }

    .weather-warnings-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid #e5e7eb;
    }

    .weather-warnings-title {
      font-size: 16px;
      font-weight: 600;
      color: #1e293b;
      margin: 0;
    }

    .weather-warnings-close {
      background: none;
      border: none;
      font-size: 22px;
      color: #64748b;
      cursor: pointer;
      line-height: 1;
    }

    .weather-warnings-body {
      padding: 16px 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .weather-warning-item {
      padding: 12px 16px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 500;
    }

    .weather-warning-algae {
      background: #fff7ed;
      border: 1px solid #fed7aa;
      color: #9a3412;
    }

    .weather-warning-override {
      background: #fef2f2;
      border: 1px solid #fecaca;
      color: #991b1b;
    }

    @media (max-width: 768px) {
      .live-weather-box {
        position: fixed;
        top: 80px;
        left: 20px;
        right: 20px;
        width: auto;
        max-width: none;
        transform: none;
        margin: 0;
        box-sizing: border-box;
        z-index: 100;
        text-align: center;
      }

      .live-weather-label {
        padding-left: 4px;
      }

      .live-weather-icon {
        margin-left: 4px;
      }
      
      .live-weather-data {
        gap: 12px;
        padding: 0;
        justify-content: center;
      }

      .live-weather-value-group {
        padding-left: 6;
      }
      
      .live-weather-value {
        font-size: 26px;
      }
      
      .live-weather-icon {
        font-size: 18px;
      }
    }

    /* Modern Tooltip Bubbles */
    .live-weather-item {
      position: relative;
      cursor: help;
    }

    .live-weather-item::before {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%) translateY(-8px);
      background: rgba(30, 41, 59, 0.95);
      color: white;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 500;
      white-space: normal;
      display: inline-block;
      width: 100px;
      text-align: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      z-index: 1000;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .live-weather-item::after {
      content: '';
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%) translateY(-2px);
      border: 6px solid transparent;
      border-top-color: rgba(30, 41, 59, 0.95);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      z-index: 1000;
    }

    .live-weather-item:hover::before {
      opacity: 1;
      transform: translateX(-50%) translateY(-12px);
    }

    .live-weather-item:hover::after {
      opacity: 1;
      transform: translateX(-50%) translateY(-6px);
    }

    /* Pro Support Hint */
    .pro-support-hint {
        padding: 0 16px 8px;
        text-align: center;
        cursor: pointer;
    }

    .pro-support-text {
        font-size: 12px;
        color: #9ca3af;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .pro-support-icon {
        font-size: 13px;
        color: #6b7280;
        cursor: help;
        transition: color 0.2s;
        user-select: none;
        filter: grayscale(100%);
        opacity: 0.5;
    }

    .pro-support-hint:hover .pro-support-icon {
        color: #36d1dc;
    }

    .pro-support-expanded {
        display: none;
        font-size: 12px;
        color: #9ca3af;
        line-height: 1.5;
        padding: 8px 12px;
        margin-top: 6px;
        background: rgba(255,255,255,0.04);
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.08);
        text-align: left;
        animation: fadeInDown 0.2s ease;
    }

    @media (hover: hover) {
        .pro-support-hint:hover .pro-support-expanded {
            display: block;
        }
    }

    .pro-support-hint.pro-hint-expanded .pro-support-expanded {
        display: block;
    }

    @keyframes fadeInDown {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .pro-support-hint {
      padding: 0 16px 8px;
      text-align: center;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
  }

    @media (max-width: 768px) {
      .pro-support-hint {
          padding: 4px 16px 10px;
          min-height: 36px;
          display: flex;
          flex-direction: column;
          align-items: center;
      }

      .pro-support-text {
          padding: 4px 8px;
      }

      .pro-support-icon {
          color: #36d1dc;
      }
  }

    .simple-toggle-btn {
      width: 44px;
      height: 24px;
      background: #cbd5e1;
      border: none;
      border-radius: 24px;
      position: relative;
      cursor: pointer;
      transition: none;
      padding: 0;
    }

    .simple-toggle-btn[data-active="true"] {
      background: #0284c7;
    }

    .toggle-indicator {
      position: absolute;
      width: 18px;
      height: 18px;
      background: white;
      border-radius: 50%;
      top: 3px;
      left: 3px;
      transition: none;
    }

    .simple-toggle-btn[data-active="true"] .toggle-indicator {
      left: 23px;
    }

    /* Map page must have zero padding */
    body.map-page {
      padding: 0 !important;
      overflow: hidden !important;
      background: #000; /* optional: hides any flash behind the map */
    }

    /* Changelog Modal Styles */
    .changelog-modal-body {
      max-height: 70vh;
      overflow-y: auto;
      padding: 24px;
    }

    @media (max-width: 768px) {
      .changelog-modal-body {
        max-height: none;
      }
    }

    .changelog-entry {
      margin-bottom: 32px;
      padding-bottom: 24px;
      border-bottom: 1px solid #e5e7eb;
    }

    .changelog-entry:last-child {
      border-bottom: none;
      margin-bottom: 0;
    }

    .changelog-version {
      font-size: 20px;
      font-weight: 700;
      color: #1e293b;
      margin-bottom: 4px;
    }

    .changelog-date {
      font-size: 13px;
      color: #64748b;
      margin-bottom: 16px;
    }

    .changelog-items {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .changelog-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      font-size: 14px;
      line-height: 1.6;
      color: #475569;
    }

    .changelog-badge {
      flex-shrink: 0;
      min-width: 80px;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      text-align: center;
    }

    .changelog-badge.new {
      background: #dcfce7;
      color: #15803d;
    }

    .changelog-badge.improved {
      background: #dbeafe;
      color: #1e40af;
    }

    .changelog-badge.fixed {
      background: #fef3c7;
      color: #92400e;
    }

    /* About Modal - Contact button on its own row */
    #contact-button {
      flex-basis: 100% !important;
    }

    /* ===========================================
    VISIBILITY PREDICTIONS STRIP
    =========================================== */

      .viz-predictions-strip {
      position: absolute;
      z-index: 999;
      height: 40px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      overflow: hidden;
      transition: opacity 0.3s ease;
      }

      /* Mobile: Predictions strip inside weather widget */
      @media (max-width: 767px) {
          .viz-predictions-strip {
              position: static; /* Remove absolute positioning */
              top: auto;
              left: auto;
              right: auto;
              margin-top: 6px; /* Space from weather content */
              margin-bottom: 0; /* Add this */
              padding-bottom: 0; /* Add this */
              border-radius: 6px;
              box-shadow: none; /* Remove shadow since it's inside widget */
              background: transparent;
          }

          .viz-strip-label {
              font-size: 9px;
              font-weight: 500;
              color: #9ca3af;
              text-transform: uppercase;
              letter-spacing: 0.5px;
              margin-top: 4px;
              margin-bottom: 0px;
              text-align: center;
          }

          .viz-strip-content {
              background: #f8f9fa;
              scroll-behavior: smooth;
              padding-bottom: 0px;
          }
          
          .viz-pill {
              background: white; /* White pill background */
              border: 1px solid #e5e7eb;
          }
          
          .viz-pill:hover {
              background: white;
          }
      }

      /* Desktop: Keep predictions strip at bottom center (outside widget) */
      @media (min-width: 768px) {
        .viz-predictions-strip {
          position: fixed;
          bottom: 20px;
          left: 50%;
          transform: translateX(-50%);
          background: white;
          border-radius: 12px;
          box-shadow: 0 2px 8px rgba(0,0,0,0.08);
          z-index: 9999;
          width: auto;
          max-width: 700px;
          min-width: 500px;
        }

        .viz-strip-label {
          position: fixed;
          bottom: 70px;
          left: 50%;
          transform: translateX(-50%);
          opacity: 0.8;
          font-size: 12px;
        }
      }

      .viz-predictions-strip.faded {
          opacity: 1;
      }

      .viz-strip-content {
          display: flex;
          gap: 8px;
          padding: 6px 10px;
          overflow-x: auto;
          overflow-y: hidden;
          height: 100%;
          align-items: center;
          scrollbar-width: none; /* Firefox */
          -ms-overflow-style: none; /* IE/Edge */
      }

      .viz-strip-content::-webkit-scrollbar {
          display: none; /* Chrome/Safari */
      }

      .viz-pill {
          flex-shrink: 0;
          display: flex;
          align-items: center;
          gap: 6px;
          padding: 6px 14px;
          background: #f2f2f2;
          border-radius: 20px;
          cursor: pointer;
          transition: all 0.2s ease;
          white-space: nowrap;
          border: 1px solid #eeeeee;
      }

      .viz-pill:hover {
          background: #f2f2f2;
          transform: translateY(-1px);
          box-shadow: 0 2px 6px rgba(0,0,0,0.08);
      }

      .viz-pill-icon {
          width: 14px;
          height: 14px;
          flex-shrink: 0;
      }

      .viz-pill-name {
          font-size: 13px;
          font-weight: 500;
          color: #374151;
      }

      .viz-pill-value {
          font-size: 14px;
          font-weight: 700;
          color: #111827;
      }

      .viz-pill-upgrade {
          background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
          border: none;
          color: white;
          padding: 6px 16px;
          position: relative;
          overflow: hidden;
      }

      .viz-pill-upgrade:hover {
          background: linear-gradient(135deg, #2dd4da 0%, #4c63d2 100%);
          transform: translateY(-1px) scale(1.02);
          box-shadow: 0 3px 10px rgba(54, 209, 220, 0.4);
      }

      .viz-pill-upgrade .viz-pill-name {
          color: white !important;
          font-weight: 600;
          position: relative;
          z-index: 1;
      }

      /* Shine effect on hover (matches menu button) */
      .viz-pill-upgrade::before {
          content: '';
          position: absolute;
          top: 0;
          left: -100%;
          width: 100%;
          height: 100%;
          background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
          transition: left 0.5s ease;
      }

      .viz-pill-upgrade:hover::before {
          left: 100%;
      }

      .viz-pill-more {
          background: white;
          border: 1px solid #e5e7eb;
      }

      .viz-pill-more .viz-pill-name {
          color: #6b7280;
          font-weight: 600;
      }

      #vizPredictionsModal {
          z-index: 10010;
      }

      /* Visibility Modal */
      .viz-modal {
          display: none;
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: rgba(0, 0, 0, 0.5);
          z-index: 10020;
          padding: 20px;
          overflow-y: auto;
      }

      .viz-modal.active {
          display: flex;
          align-items: center;
          justify-content: center;
      }

      .viz-modal-content {
          background: white;
          border-radius: 16px;
          max-width: 500px;
          width: 100%;
          max-height: 90vh;
          overflow-y: auto;
          box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      }

      .viz-modal-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 20px 24px;
          border-bottom: 1px solid #f3f4f6;
      }

      .viz-modal-header h3 {
          margin: 0;
          font-size: 18px;
          font-weight: 700;
          color: #111827;
      }

      .viz-modal-close {
          background: none;
          border: none;
          font-size: 28px;
          color: #9ca3af;
          cursor: pointer;
          padding: 0;
          width: 32px;
          height: 32px;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 8px;
          transition: all 0.2s ease;
      }

      .viz-modal-close:hover {
          background: #f3f4f6;
          color: #374151;
      }

      .viz-modal-body {
          padding: 24px;
      }

      .viz-loading {
          text-align: center;
          padding: 40px;
          color: #9ca3af;
          font-size: 14px;
      }

      .viz-detail-section {
          margin-bottom: 24px;
      }

      .viz-detail-section:last-child {
          margin-bottom: 0;
      }

      .viz-detail-section h4 {
          font-size: 11px;
          font-weight: 600;
          color: #9ca3af;
          text-transform: uppercase;
          letter-spacing: 0.5px;
          margin-bottom: 12px;
      }

      .viz-main-display {
          display: flex;
          align-items: center;
          gap: 12px;
          margin-bottom: 12px;
      }

      .viz-main-icon {
          width: 24px;
          height: 24px;
      }

      .viz-main-value {
          font-size: 42px;
          font-weight: 700;
          color: #111827;
          line-height: 1;
      }

      .viz-confidence {
          font-size: 14px;
          color: #6b7280;
          margin-bottom: 4px;
      }

      .viz-error-band {
          font-size: 13px;
          color: #9ca3af;
      }

      /* Viz Modal Expandable Info Section */
      .viz-info-expandable {
          margin-top: 20px;
          margin-bottom: 30px;
      }

      .viz-info-toggle {
          width: 100%;
          display: flex;
          align-items: center;
          gap: 8px;
          padding: 14px 18px;
          background: linear-gradient(to bottom, #ffffff, #f8fafc);
          border: 1px solid #e5e7eb;
          border-radius: 10px;
          color: #374151;
          font-weight: 500;
          font-size: 16px;
          cursor: pointer;
          transition: all 0.2s ease;
          text-align: left;
      }

      .viz-info-toggle:hover {
          background: linear-gradient(to bottom, #f9fafb, #f1f5f9);
          border-color: #cbd5e1;
          box-shadow: 0 2px 8px rgba(0,0,0,0.06);
      }

      .viz-info-toggle:active {
          transform: scale(0.99);
      }

      .viz-toggle-arrow {
          margin-left: auto;
          transition: transform 0.3s ease;
      }

      .viz-info-toggle.active .viz-toggle-arrow {
          transform: rotate(180deg);
      }

      .viz-info-content {
          margin-top: 16px;
          padding: 20px;
          background: #ffffff;
          border: 1px solid #e5e7eb;
          border-radius: 10px;
          animation: slideDown 0.3s ease;
      }

      @keyframes slideDown {
          from {
              opacity: 0;
              transform: translateY(-10px);
          }
          to {
              opacity: 1;
              transform: translateY(0);
          }
      }

      .viz-info-section {
          margin-bottom: 24px;
      }

      .viz-info-section:last-child {
          margin-bottom: 0;
      }

      .viz-info-section h4 {
          color: #1e293b;
          font-size: 16px;
          font-weight: 600;
          margin: 0 0 10px 0;
      }

      .viz-info-section p {
          color: #475569;
          font-size: 16px;
          line-height: 1.6;
          margin: 0 0 12px 0;
      }

      .viz-info-section p:last-child {
          margin-bottom: 0;
      }

      .viz-info-section ul {
          margin: 8px 0;
          padding-left: 20px;
          color: #475569;
          font-size: 16px;
          line-height: 1.6;
      }

      .viz-info-section li {
          margin-bottom: 6px;
      }

      .viz-info-section li strong {
          color: #1e293b;
          font-weight: 600;
      }

      /* Mobile responsiveness for viz info */
      @media (max-width: 768px) {
          .viz-info-toggle {
              padding: 12px 16px;
              font-size: 15px;
          }
          
          .viz-info-content {
              padding: 16px;
          }
          
          .viz-info-section h4 {
              font-size: 16px;
          }
          
          .viz-info-section p,
          .viz-info-section ul {
              font-size: 15px;
          }
      }

      /* Map button in header */
.viz-map-btn {
    position: absolute;
    right: 50px; /* Space for close button */
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.viz-map-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.viz-map-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Major Impacts Section */
.viz-impacts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.viz-impact-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

.viz-impact-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(148, 163, 184, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.viz-impact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    position: relative;
}

.viz-impact-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.viz-impact-value {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.5px;
}

/* Current Conditions Section */
.viz-modifiers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.viz-modifier-card {
    background: #f9fafb;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.viz-modifier-icon {
    width: 24px;
    height: 24px;
    margin: 0 auto 8px auto;
    display: block;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.viz-modifier-card:hover .viz-modifier-icon {
    opacity: 1;
}

.viz-modifier-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.viz-modifier-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

/* Bar styles */
.viz-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.viz-bar-track-small {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.viz-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s ease;
}

/* Status badges */
.viz-status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .viz-map-btn {
        right: 45px; /* Closer on mobile */
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .viz-impacts-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
    
    .viz-modifiers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .viz-modifier-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 6px;
    }
    
    .viz-modifier-value {
        font-size: 14px;
    }
}

      /* Mobile peek animation */
      @keyframes viz-peek {
          0%, 100% { transform: translateX(0); }
          50% { transform: translateX(-20px); }
      }

      .viz-strip-content.peek {
          animation: viz-peek 1.5s ease-in-out;
      }

      /* Viz Predictions Modal */
      .viz-group {
          margin-bottom: 24px;
      }

      .viz-group-header {
          display: flex;
          align-items: center;
          gap: 8px;
          font-weight: 600;
          font-size: 14px;
          color: #374151;
          margin-bottom: 12px;
          padding-bottom: 8px;
          border-bottom: 1px solid #e5e7eb;
      }

      .viz-group-count {
          margin-left: auto;
          background: #f3f4f6;
          padding: 2px 8px;
          border-radius: 12px;
          font-size: 12px;
          color: #6b7280;
      }

      .viz-group-sites {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
          gap: 12px;
      }

      .viz-site-card {
          background: #f9fafb;
          padding: 12px 16px;
          border-radius: 10px;
          cursor: pointer;
          transition: all 0.2s ease;
      }

      .viz-site-card:hover {
          background: #f3f4f6;
          transform: translateY(-1px);
          box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      }

      .viz-site-card-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 4px;
      }

      .viz-site-name {
          font-weight: 600;
          font-size: 14px;
          color: #111827;
      }

      .viz-site-value {
          font-weight: 700;
          font-size: 16px;
          color: #111827;
      }

      .viz-site-details {
          font-size: 12px;
          color: #6b7280;
      }

      .viz-predictions-strip::before {
          content: attr(data-tooltip);
          position: absolute;
          bottom: 100%;
          left: 50%;
          transform: translateX(-50%) translateY(-8px);
          background: rgba(30, 41, 59, 0.95);
          color: white;
          padding: 10px 14px;
          border-radius: 8px;
          font-size: 12px;
          font-weight: 500;
          white-space: pre-line;
          text-align: center;
          width: auto;
          max-width: 220px;
          opacity: 0;
          pointer-events: none;
          transition: opacity 0.2s ease, transform 0.2s ease;
          z-index: 1001;
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
          line-height: 1.4;
      }

      /* Tooltip arrow */
      .viz-predictions-strip::after {
          content: '';
          position: absolute;
          bottom: 100%;
          left: 50%;
          transform: translateX(-50%) translateY(-2px);
          border: 6px solid transparent;
          border-top-color: rgba(30, 41, 59, 0.95);
          opacity: 0;
          pointer-events: none;
          transition: opacity 0.2s ease, transform 0.2s ease;
          z-index: 1001;
      }

      /* Show on hover */
      .viz-predictions-strip:hover::before {
          opacity: 1;
          transform: translateX(-50%) translateY(-12px);
      }

      .viz-predictions-strip:hover::after {
          opacity: 1;
          transform: translateX(-50%) translateY(-6px);
      }

      /* Disable tooltip on mobile */
      @media (max-width: 768px) {
          .viz-predictions-strip {
              cursor: default;
          }
          
          .viz-predictions-strip::before,
          .viz-predictions-strip::after {
              display: none;
          }
      }

      /* Tide graph section */
      .tide-graph-container {
          background: #f9fafb;
          border: 1px solid #e5e7eb;
          border-radius: 12px;
          padding: 16px;
          margin-bottom: 12px;
          width: 100%;
          overflow-x: auto;
          overflow-y: hidden;
      }

      .tide-graph-container canvas {
          display: block;
      }

      /* Smooth scrollbar for tide graph */
      .tide-graph-container::-webkit-scrollbar {
          height: 6px;
      }

      .tide-graph-container::-webkit-scrollbar-track {
          background: #f3f4f6;
          border-radius: 3px;
      }

      .tide-graph-container::-webkit-scrollbar-thumb {
          background: #cbd5e1;
          border-radius: 3px;
      }

      .tide-graph-container::-webkit-scrollbar-thumb:hover {
          background: #94a3b8;
      }

      .tide-next-events {
          display: flex;
          flex-direction: column;
          gap: 10px;
      }

      .tide-event-icon {
          width: 20px;
          height: 20px;
          flex-shrink: 0;
      }

      .tide-info-item {
          display: flex;
          align-items: center;
          gap: 12px;
          padding: 12px;
          background: #f9fafb;
          border: 1px solid #e5e7eb;
          border-radius: 10px;
      }

      .tide-icon {
          font-size: 20px;
          flex-shrink: 0;
      }

      .tide-info-text {
          font-size: 13px;
          color: #374151;
      }

      .tide-info-text strong {
          color: #111827;
          font-weight: 600;
      }

      /* Mobile adjustments */
      @media (max-width: 480px) {
          .tide-graph-container {
              padding: 12px;
          }
          
          .tide-graph-container canvas {
              min-width: 500px; /* Allow horizontal scroll on mobile */
          }
      }

      /* ==========================================
      DIVE SITE DISPLAY MODE CONTROL
      ========================================== */

    .site-display-mode-control {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .site-mode-btn {
        /* Inherits from .settings-option styling already in place */
    }

    .site-mode-btn .premium-badge {
        font-size: 10px;
        margin-left: 3px;
        opacity: 1;
    }

    .site-mode-btn.locked {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .site-mode-btn.locked:hover {
        background: #f8fafc;
    }

    .premium-notice {
        margin-top: 10px;
        padding: 10px 12px;
        background: #fef3c7;
        border: 1px solid #fcd34d;
        border-radius: 6px;
        text-align: center;
    }

  .premium-notice small {
      color: #92400e;
      font-size: 12px;
  }

  /* ==========================================
  Pelagic Account Settings Modal
  ========================================== */

/* Pelagic Settings Modal - Light Theme, Inter, larger readable sizes */

.pelagic-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.pelagic-settings-modal.psm-open {
    display: block;
}

/* Overlay */
.pelagic-settings-modal .psm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Panel */
.pelagic-settings-modal .psm-panel {
    position: relative;
    z-index: 1;
    margin: 40px auto;
    max-width: 1000px;
    max-height: 90vh;
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    display: flex;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Close button */
.pelagic-settings-modal .psm-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
    z-index: 10;
}

.pelagic-settings-modal .psm-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Sidebar */
.pelagic-settings-modal .psm-sidebar {
    width: 250px;
    padding: 24px 20px 18px;
    border-right: 1px solid #f3f4f6;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pelagic-settings-modal .psm-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.pelagic-settings-modal .psm-nav-item {
    border: none;
    background: transparent;
    padding: 10px 12px;
    text-align: left;
    border-radius: 10px;
    font-size: 15px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pelagic-settings-modal .psm-nav-item:hover {
    background: #eef2ff;
    color: #111827;
}

.pelagic-settings-modal .psm-nav-item.active {
    background: linear-gradient(135deg, #36d1dc, #5b86e5);
    color: #ffffff;
    font-weight: 600;
}

/* Content */
.pelagic-settings-modal .psm-content {
    flex: 1;
    padding: 26px 26px 20px;
    overflow-y: auto;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.7;
    color: #111827;
}

.pelagic-settings-modal .psm-tab {
    display: none;
}

.pelagic-settings-modal .psm-tab.active {
    display: block;
}

.pelagic-settings-modal .psm-tab h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.pelagic-settings-modal .psm-subtitle {
    margin: 0 0 20px;
    font-size: 15px;
    color: #6b7280;
}

/* Cards */
.pelagic-settings-modal .psm-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px 18px 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
}

.pelagic-settings-modal .psm-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.pelagic-settings-modal .psm-card-help {
    margin: 0 0 10px;
    font-size: 14px;
    color: #6b7280;
}

/* Labels & values */
.pelagic-settings-modal .psm-label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 8px;
}

.pelagic-settings-modal .psm-value,
.pelagic-settings-modal .psm-value-block {
    font-size: 15px;
    color: #111827;
    margin-top: 3px;
    word-break: break-word;
}

/* Actions / buttons */
.pelagic-settings-modal .psm-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pelagic-settings-modal .psm-button,
.pelagic-settings-modal #stripeupdatecard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pelagic-settings-modal .psm-button:hover,
.pelagic-settings-modal #stripeupdatecard:hover {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1d4ed8;
}

/* Danger card */
.pelagic-settings-modal .psm-card.psm-danger {
    border-color: #fecaca;
    background: #fff7f7;
}

.pelagic-settings-modal .psm-card.psm-danger h3 {
    color: #b91c1c;
}

.pelagic-settings-modal .psm-card.psm-danger .psm-card-help {
    color: #7f1d1d;
}

/* Transactions */
.pelagic-settings-modal .psm-transactions-scroll {
    max-height: 280px;
    overflow-y: auto;
    margin-top: 10px;
}

.pelagic-settings-modal .psm-empty {
    font-size: 14px;
    color: #9ca3af;
    margin: 4px 0 0;
}

/* Mobile: full screen */
@media (max-width: 768px) {
    .pelagic-settings-modal .psm-panel {
        margin: 0;
        max-width: 100%;
        max-height: 100vh;
        width: 100%;
        height: 100%;
        border-radius: 0;
        flex-direction: column;
    }

    .pelagic-settings-modal .psm-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 14px 12px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        overflow-x: auto;
    }

    .pelagic-settings-modal .psm-title {
        font-size: 18px;
        margin-right: 10px;
        white-space: nowrap;
    }

    .pelagic-settings-modal .psm-nav-item {
        font-size: 14px;
        padding: 8px 11px;
        white-space: nowrap;
    }

    .pelagic-settings-modal .psm-content {
        padding: 18px 12px 12px;
        font-size: 15px;
    }

    .pelagic-settings-modal .psm-close {
        top: 10px;
        right: 10px;
    }
}

/* Legal Dropdown */
.legal-dropdown {
    position: relative;
    display: inline-block;
}

.legal-toggle {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.legal-toggle:hover {
    opacity: 0.8;
}

.legal-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    margin-bottom: 8px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.legal-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.legal-menu a {
    display: block;
    padding: 10px 16px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.legal-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.legal-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

.legal-menu a:hover {
    background: #f8f9fa;
}

/* ========================================
   DIVE SITE MODAL STYLE - Ocean Theme
   ======================================== */

/* Modal container - narrower for better readability */
.fullscreen-modal.modal-style-dive-site .modal-content {
  max-width: 750px;
  background: #ffffff;
  height: 85vh;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fullscreen-modal.modal-style-dive-site .modal-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
  padding: 28px 32px 24px;
  border-bottom: none;
  position: relative;
  overflow: hidden;
}

/* Subtle wave effect overlay on header */
.fullscreen-modal.modal-style-dive-site .modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.05) 50%, 
    transparent 100%);
  pointer-events: none;
}

.fullscreen-modal.modal-style-dive-site .modal-title {
  color: #ffffff;
  font-size: 33px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fullscreen-modal.modal-style-dive-site .close-btn {
  color: #ffffff;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  font-size: 28px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.fullscreen-modal.modal-style-dive-site .close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.fullscreen-modal.modal-style-dive-site .modal-body {
  padding: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Modern pill-style tabs */
.fullscreen-modal.modal-style-dive-site .site-popup-tabs {
  display: flex;
  gap: 8px;
  background: #f8fafc;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.fullscreen-modal.modal-style-dive-site .site-popup-tab {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 10px;
  position: relative;
  border-bottom: none;
}

.fullscreen-modal.modal-style-dive-site .site-popup-tab:hover {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.08);
}

.fullscreen-modal.modal-style-dive-site .site-popup-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
  border-bottom-color: transparent;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.fullscreen-modal.modal-style-dive-site .site-popup-tab:active {
  transform: scale(0.97);
}

/* Tab content padding */
.fullscreen-modal.modal-style-dive-site .site-tab-content {
  padding: 24px 32px 32px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .fullscreen-modal.modal-style-dive-site .modal-content {
    max-width: 100%;
    border-radius: 0;
  }
  
  .fullscreen-modal.modal-style-dive-site .modal-header {
    padding: 24px 20px 20px;
    border-radius: 0 !important;
  }
  
  .fullscreen-modal.modal-style-dive-site .modal-title {
    font-size: 24px;
  }
  
  .fullscreen-modal.modal-style-dive-site .close-btn {
    width: 32px;
    height: 32px;
    font-size: 24px;
  }
  
  .fullscreen-modal.modal-style-dive-site .site-popup-tabs {
    padding: 12px 16px;
    gap: 6px;
  }
  
  .fullscreen-modal.modal-style-dive-site .site-popup-tab {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .fullscreen-modal.modal-style-dive-site .site-tab-content {
    padding: 20px 20px 24px;
  }
}

/* =========================
   SERVICE MODAL STYLES - HIGHLY SPECIFIC
   ========================= */

.fullscreen-modal.modal-style-service .modal-content {
  max-width: 600px;
  height: 80vh;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fullscreen-modal.modal-style-service .modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Remove padding from modal-body - SERVICE ONLY */
.fullscreen-modal.modal-style-service .modal-body {
  padding: 0 !important;
}

/* Remove padding from feature-grid - SERVICE ONLY */
.fullscreen-modal.modal-style-service #feature-grid {
  padding: 0 !important;
}

/* Image wrapper - SERVICE ONLY */
.fullscreen-modal.modal-style-service .service-image-wrapper {
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  overflow: hidden;
}

/* 16:9 aspect ratio container - SERVICE ONLY */
.fullscreen-modal.modal-style-service .service-image-wrapper::before {
  content: '';
  display: block;
  padding-top: 56.25%;
}

.fullscreen-modal.modal-style-service .service-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.fullscreen-modal.modal-style-service .service-image.loaded {
  opacity: 1;
}

/* Padded content container - SERVICE ONLY */
.fullscreen-modal.modal-style-service .service-content-padded {
  padding: 24px 32px 32px 32px;
}

/* Intro text - SERVICE ONLY */
.fullscreen-modal.modal-style-service .service-intro {
  padding: 20px 0 0 0;
  color: #1e293b;
  font-size: 19px;
  line-height: 1.6;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  text-align: center;
}

.fullscreen-modal.modal-style-service .service-intro p {
  margin: 0;
}

/* Action buttons - SERVICE ONLY */
.fullscreen-modal.modal-style-service .service-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.fullscreen-modal.modal-style-service .service-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}

.fullscreen-modal.modal-style-service .service-btn svg {
  flex-shrink: 0;
}

.fullscreen-modal.modal-style-service .service-btn-book {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

.fullscreen-modal.modal-style-service .service-btn-book:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.fullscreen-modal.modal-style-service .service-btn-call {
  background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}

.fullscreen-modal.modal-style-service .service-btn-call:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.fullscreen-modal.modal-style-service .service-btn-navigate {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.fullscreen-modal.modal-style-service .service-btn-navigate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Additional details section - SERVICE ONLY */
.fullscreen-modal.modal-style-service .service-details {
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
  margin-top: 20px;
}

/* Modal header styling - SERVICE ONLY */
.fullscreen-modal.modal-style-service .modal-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

.fullscreen-modal.modal-style-service .modal-title {
  color: white;
}

.fullscreen-modal.modal-style-service .close-btn {
  color: white;
  opacity: 0.9;
}

.fullscreen-modal.modal-style-service .close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* =========================
   MOBILE ADJUSTMENTS - SERVICE ONLY
   ========================= */
@media (max-width: 768px) {
  /* Position modal at bottom - SERVICE ONLY */
  .fullscreen-modal.modal-style-service {
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }
  
  /* Modal slides up from bottom - SERVICE ONLY */
  .fullscreen-modal.modal-style-service .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 70vh !important;
    max-height: 70vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transform: translateY(0) !important;
  }
  
  /* Image wrapper - SERVICE ONLY */
  .fullscreen-modal.modal-style-service .service-image-wrapper::before {
    padding-top: 50%;
  }
  
  /* Content padding - SERVICE ONLY */
  .fullscreen-modal.modal-style-service .service-content-padded {
    padding: 20px 20px 20px 20px;
  }
  
  /* ALL THREE BUTTONS ON ONE ROW - SERVICE ONLY */
  .fullscreen-modal.modal-style-service .service-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    margin-bottom: 20px;
  }
  
  .fullscreen-modal.modal-style-service .service-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 4px;
    font-size: 13px;
    gap: 4px;
    font-weight: 600;
  }
  
  .fullscreen-modal.modal-style-service .service-btn svg {
    width: 16px;
    height: 16px;
  }
  
  /* Intro text on mobile - SERVICE ONLY */
  .fullscreen-modal.modal-style-service .service-intro {
    font-size: 17px;
    line-height: 1.6;
    padding: 16px 0 0 0;
  }
  
  /* Details section - SERVICE ONLY */
  .fullscreen-modal.modal-style-service .service-details {
    padding-top: 16px;
    margin-top: 16px;
  }

  .fullscreen-modal.modal-style-service .modal-content,
  .fullscreen-modal.modal-style-service .modal-header,
  .fullscreen-modal.modal-style-service .modal-body {
  border-radius: 0 !important;
  }
}

/* =========================
   WARNING MODAL STYLES
   ========================= */
.fullscreen-modal.modal-style-warning .modal-header {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.fullscreen-modal.modal-style-warning .modal-title {
  color: white;
}

.fullscreen-modal.modal-style-warning .close-btn {
  color: white;
  opacity: 0.9;
}

.fullscreen-modal.modal-style-warning .close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* =========================
   SPECIAL POI MODAL STYLES
   ========================= */
.fullscreen-modal.modal-style-special .modal-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.fullscreen-modal.modal-style-special .modal-title {
  color: white;
}

.fullscreen-modal.modal-style-special .close-btn {
  color: white;
  opacity: 0.9;
}

.fullscreen-modal.modal-style-special .close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* =========================
   MOBILE ADJUSTMENTS
   ========================= */
@media (max-width: 768px) {
  .service-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .service-btn {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
    gap: 12px;
  }
  
  .service-image {
    max-height: 200px;
  }
  
  .fullscreen-modal.modal-style-service .modal-content {
    max-width: 100%;
  }
}

/* Version in side menu */
.menu-version {
  padding: 12px 20px;
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
  color: #94a3b8;
  text-align: center;
  user-select: text;
  cursor: pointer;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.menu-version:hover {
  color: #1e293b;
  background: #f8fafc;
}

.menu-version-badge {
  display: inline-block;
  padding: 3px 8px;
  background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 10px;
  margin-right: 6px;
  vertical-align: middle;
}

.menu-pro-badge {
  display: inline-block;
  padding: 3px 8px;
  background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
  color: #7a4a00;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 10px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Details Tab - Section Cards */
.details-section-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 16px;
  overflow: hidden;
}

.details-section-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.details-section-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
}

.details-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  transition: background 0.2s ease;
}

.details-item:hover {
  background: #f8fafc;
}

.details-item-full {
  grid-column: 1 / -1;
  border-right: none;
}

.details-item:last-child {
  border-bottom: none;
}

.details-item-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.details-item-value {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  font-weight: 500;
}

.details-item-full .details-item-value {
  font-size: 16px;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .details-section-content {
    grid-template-columns: 1fr;
  }
  
  .details-item {
    border-right: none;
  }
}

/* Improvement 2: Better readability for long content */
.details-item-full {
  grid-column: 1 / -1;
  border-right: none;
  background: #fafbfc;
  padding: 20px 24px;
}

.details-item-full .details-item-value {
  font-size: 16px;
  line-height: 1.8;
}

/* Improvement 3: Subtle card hover animation */
.details-section-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.details-section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(15, 23, 42, 0.06);
}

/* Live Weather Box swell and wind direction arrows */
.direction-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 14px;
    font-weight: 900;
    color: #0C9AC6;
    transition: transform 0.3s ease;
    transform-origin: center;
    -webkit-text-stroke: 0.2px #0C9AC6;
    text-stroke: 0.2px #0C9AC6;
}

/* ═══════════════════════════════════════════════════════
   DIVE LOGBOOK MODAL
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  #dive-logbook-modal .modal-content {
    width: 100% !important; height: 100% !important;
    max-height: none !important; margin: 0 !important;
    border-radius: 0 !important; position: fixed !important;
    top: 0 !important; left: 0 !important; bottom: 0 !important;
    display: flex !important; flex-direction: column !important;
  }
  #dive-logbook-modal .modal-header { flex-shrink: 0 !important; }
  #dive-logbook-modal .modal-body   { flex: 1 !important; overflow-y: auto !important; min-height: 0 !important; -webkit-overflow-scrolling: touch !important; }
}

/* Stats bar */
#logbook-stats {
  padding: 20px 20px 0;
  background: #fff;
}
.logbook-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.logbook-stat-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(15,23,42,0.05);
}
.logbook-stat-val { font-size: 24px; font-weight: 800; color: #1e293b; line-height: 1; margin-bottom: 5px; letter-spacing: -0.03em; }
.logbook-stat-val-sm { font-size: 14px; font-weight: 700; letter-spacing: 0; }
.logbook-stat-lbl { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* Toolbar */
#logbook-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.logbook-toolbar-left  { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; align-items: center; }
.logbook-toolbar-right { display: flex; gap: 8px; align-items: center; }

.logbook-filter-select,
.logbook-sort-select {
  height: 36px;
  padding: 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  background: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.logbook-filter-select:focus,
.logbook-sort-select:focus { border-color: #0ea5e9; }
#logbook-count { font-size: 13px; color: #94a3b8; white-space: nowrap; }

.logbook-export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(14,165,233,0.25);
}
.logbook-export-btn:hover  { opacity: 0.9; }
.logbook-export-btn.locked { background: linear-gradient(135deg, #94a3b8, #cbd5e1); box-shadow: none; }

/* 3-column grid */
#logbook-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
}
@media (max-width: 800px) { #logbook-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { #logbook-grid { grid-template-columns: 1fr; } }

/* Log card */
.logbook-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(15,23,42,0.05);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  overflow: hidden;
}
.logbook-card:hover {
  box-shadow: 0 8px 24px rgba(15,23,42,0.10);
  border-color: #bae6fd;
  transform: translateY(-2px);
}

/* Coloured top border strip by visibility */
.logbook-card-strip {
  height: 4px;
  width: 100%;
  border-radius: 16px 16px 0 0;
}

/* Card inner padding wrapper */
.logbook-card-inner {
  padding: 16px 18px 18px;
}

.logbook-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.logbook-card-num {
  font-size: 11px;
  font-weight: 700;
  color: #0ea5e9;
  background: #e0f2fe;
  border-radius: 20px;
  padding: 3px 9px;
  letter-spacing: 0.02em;
}
.logbook-card-actions { display: flex; align-items: center; gap: 6px; }

/* Star rating as pips */
.logbook-card-stars {
  display: flex;
  gap: 3px;
  margin: 10px 0 6px;
}
.logbook-star-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.logbook-star-pip.filled  { background: #f59e0b; }
.logbook-star-pip.empty   { background: #e2e8f0; }

.logbook-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.15s;
  flex-shrink: 0;
}
.logbook-action-btn:hover  { background: #f8fafc; }
.logbook-edit-btn:hover    { border-color: #bae6fd; color: #0ea5e9; background: #f0f9ff; }
.logbook-delete-btn:hover  { border-color: #fecaca; color: #ef4444; background: #fff5f5; }

/* Date displayed as calendar tear-off */
.logbook-card-date-block {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 4px;
}
.logbook-card-date-day {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
  letter-spacing: -0.03em;
}
.logbook-card-date-rest {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.3;
}

/* Site name below date */
.logbook-card-site {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Type icon-only pill */
.logbook-card-type {
  display: inline-flex;
  align-items: center;
}

/* Metrics — label above value */
.logbook-card-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 8px;
}
.logbook-metric {
  text-align: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 4px 10px;
}
.logbook-metric-lbl { font-size: 9px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; margin-bottom: 4px; }
.logbook-metric-val { font-size: 15px; font-weight: 700; color: #1e293b; line-height: 1; }
.logbook-metric-vis { /* colour set inline via JS vis scale */ }

/* Notes — italicised with teal left border */
.logbook-card-notes {
  font-size: 12px;
  font-style: italic;
  color: #64748b;
  line-height: 1.5;
  border-left: 3px solid #7dd3fc;
  padding: 4px 0 4px 10px;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination */
#logbook-pagination { padding: 12px 20px 20px; }
.logbook-page-controls { display: flex; justify-content: center; gap: 4px; }
.logbook-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}
.logbook-page-btn:hover:not(.disabled):not(.active) { border-color: #0ea5e9; color: #0ea5e9; }
.logbook-page-btn.active   { background: #0ea5e9; border-color: #0ea5e9; color: white; font-weight: 700; }
.logbook-page-btn.disabled { opacity: 0.35; cursor: default; }
.logbook-page-ellipsis     { line-height: 32px; padding: 0 4px; color: #94a3b8; font-size: 13px; }

/* Empty / loading */
.logbook-empty,
.logbook-loading { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: #94a3b8; }
.logbook-empty-title { font-size: 16px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.logbook-empty-sub   { font-size: 13px; }
.logbook-retry-btn {
  margin-top: 14px;
  padding: 8px 20px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
}
.logbook-spinner {
  width: 28px; height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: logbook-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes logbook-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   EDIT LOG MODAL — Modern Google-style form
   ═══════════════════════════════════════════════════════ */

.logbook-edit-site {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.logbook-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.logbook-edit-field {
  display: flex;
  flex-direction: column;
  position: relative;
}

.logbook-edit-field-full { margin-bottom: 8px; }

/* Floating label wrapper */
.logbook-edit-field label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.logbook-edit-field:focus-within label {
  color: #94a3b8;
}

.logbook-edit-required { color: #ef4444; }

/* Inputs — pill style, filled background */
.logbook-edit-field input,
.logbook-edit-field select,
.logbook-edit-field textarea {
  height: 42px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: #f1f5f9;
  outline: none;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.logbook-edit-field select {
  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='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.logbook-edit-field input:hover,
.logbook-edit-field select:hover,
.logbook-edit-field textarea:hover {
  background: #e8eef5;
}

.logbook-edit-field input:focus,
.logbook-edit-field textarea:focus {
  background: white;
  border-color: #e2e8f0;
  box-shadow: none;
}

.logbook-edit-field select:focus {
  background: white;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

/* Valid state — subtle green tint when filled */
.logbook-edit-field input:not(:placeholder-shown):not(:focus),
.logbook-edit-field select:not(:focus) {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.logbook-edit-field textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
  border-radius: 12px;
  min-height: 80px;
}

/* Number input — remove spinners for cleaner look */
.logbook-edit-field input[type="number"]::-webkit-inner-spin-button,
.logbook-edit-field input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

/* Date/time picker icon tint */
.logbook-edit-field input[type="date"]::-webkit-calendar-picker-indicator,
.logbook-edit-field input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.4;
  cursor: pointer;
}

.logbook-edit-error {
  background: #fff5f5;
  border: 1.5px solid #fecaca;
  color: #ef4444;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.logbook-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
}

.logbook-edit-cancel-btn {
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.logbook-edit-cancel-btn:hover { background: #e2e8f0; color: #374151; }

.logbook-edit-save-btn {
  height: 40px;
  padding: 0 24px;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
  letter-spacing: 0.1px;
}
.logbook-edit-save-btn:hover    { opacity: 0.92; box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35); }
.logbook-edit-save-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ═══════════════════════════════════════════════════════
   DELETE CONFIRM OVERLAY
   ═══════════════════════════════════════════════════════ */

.logbook-delete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.logbook-delete-box {
  background: white;
  border-radius: 16px;
  padding: 28px 28px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
}
.logbook-delete-title   { font-size: 17px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.logbook-delete-sub     { font-size: 14px; color: #64748b; margin-bottom: 8px; }
.logbook-delete-warning { font-size: 12px; color: #ef4444; margin-bottom: 22px; font-weight: 500; }
.logbook-delete-btns    { display: flex; gap: 10px; justify-content: center; }

.logbook-confirm-delete-btn {
  height: 40px;
  padding: 0 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.logbook-confirm-delete-btn:hover    { background: #dc2626; }
.logbook-confirm-delete-btn:disabled { opacity: 0.6; cursor: default; }

/* ========================
   SITE FEED
   ======================== */

#overview-site-feed {
    animation: fadeIn 0.3s ease;
}

#site-feed-posts .feed-empty-state {
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

#feed-post-body:focus {
    border-color: #0ea5e9 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#feed-post-body::placeholder {
    color: #94a3b8;
}