/* ==========================================================================
   SOUTH AFRICAN DIVE PLANNER - FLUID RESOLUTION-INDEPENDENT STYLESHEET
   Zero External Dependencies - Fluid Typography & Viewport-Relative Scaling
   Seamlessly scales between 1080p and 1440p+ displays
   ========================================================================== */

/* 1. Fluid Base Typography: Root HTML scaling clamp */
html {
  font-size: clamp(14px, 1vw + 0.5rem, 18px);
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

:root {
  color-scheme: dark;

  /* Color Palette: Deep Ocean & Marine Accents */
  --bg-abyss: #040912;
  --bg-deep: #071322;
  --bg-surface: rgba(11, 25, 44, 0.78);
  --bg-surface-elevated: rgba(15, 34, 60, 0.9);
  --bg-card: rgba(13, 30, 53, 0.72);
  --bg-card-hover: rgba(18, 41, 72, 0.82);

  /* Borders & Glows */
  --border-subtle: rgba(56, 189, 248, 0.16);
  --border-focus: rgba(56, 189, 248, 0.5);
  --border-emerald: rgba(52, 211, 153, 0.38);
  --border-amber: rgba(251, 191, 36, 0.42);
  --border-rose: rgba(244, 63, 94, 0.42);
  --focus-ring: #38bdf8;

  /* Accents */
  --teal-primary: #0ea5e9;
  --teal-glow: #38bdf8;
  --seafoam: #2dd4bf;
  --seafoam-light: #5eead4;
  --emerald-accent: #10b981;
  --amber-alert: #f59e0b;
  --rose-danger: #f43f5e;
  --ice-cold: #38bdf8;
  --waze-blue: #00d6ff;
  --google-blue: #4285f4;

  /* Typography (WCAG AA compliant on dark surfaces) */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #94a3b8;

  /* Elevation (Fluid Shadows) */
  --shadow-sm: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.35);
  --shadow-md: 0 0.5rem 1.5rem -0.25rem rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 1rem 2.25rem -0.375rem rgba(0, 0, 0, 0.65);
  --glow-cyan: 0 0 1.5rem rgba(14, 165, 233, 0.18);

  /* Proportional Radius Units */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;

  /* Native Typography Stack */
  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Accessibility Utilities & Keyboard Focus */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus-visible {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Universal Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-abyss);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(45, 212, 191, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(2, 132, 199, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #040912 0%, #071322 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Elastic App Container - Maximized Fluid Viewport Width (95vw)
   ========================================================================== */
.app-container {
  width: 95vw;
  max-width: 120rem; /* Scales smoothly from 1080p through 1440p without rigid clipping */
  margin: 0 auto;
  padding: 1.5rem 1.25vw 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ==========================================================================
   Header & Navigation (Proportional UI Elements)
   ========================================================================== */
.main-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.125rem 1.75rem;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-icon {
  width: 2.875rem;
  height: 2.875rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 1rem rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #ffffff 0%, var(--seafoam-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* .header-badges removed — status badges relocated to footer */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge.airgap-badge {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.3);
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--emerald-accent);
  box-shadow: 0 0 0.625rem var(--emerald-accent);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .pulse-dot {
    animation: beaconPulse 2s infinite ease-in-out;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: var(--teal-glow);
}

.theme-toggle-btn[aria-pressed="true"] {
  background: #0f172a;
  color: #f8fafc;
  border-color: #0f172a;
}

.status-badge.status-idle {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
}

.status-badge.status-idle .pulse-dot {
  background-color: #94a3b8;
  box-shadow: none;
  animation: none;
}

.status-badge.status-idle .status-text {
  color: #cbd5e1;
}

.status-badge.status-cached {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
}

.status-badge.status-cached .pulse-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 0.5rem #f59e0b;
}

.status-badge.status-cached .status-text {
  color: #fde68a;
}

.status-badge.status-unavailable {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
}

.status-badge.status-unavailable .pulse-dot {
  background-color: #f43f5e;
  box-shadow: none;
  animation: none;
}

.status-badge.status-unavailable .status-text {
  color: #fecdd3;
}

@keyframes beaconPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 0.875rem var(--emerald-accent); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-text {
  font-size: 0.78rem;
  color: #6ee7b7;
  font-weight: 600;
}

.airgap-badge .status-text {
  color: #38bdf8;
}

/* ==========================================================================
   Search & Interactive Filter
   ========================================================================== */
.search-section {
  width: 100%;
}

.search-card {
  width: 100%;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.search-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--seafoam-light);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.search-bar-wrap {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  width: 100%;
}

.search-input-box {
  flex: 1 1 18rem;
  min-width: 17.5rem;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--teal-glow);
  pointer-events: none;
}

.search-input-box input {
  width: 100%;
  padding: 0.875rem 2.75rem 0.875rem 3rem;
  border-radius: var(--radius-md);
  background: rgba(7, 18, 33, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.search-input-box input:focus {
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2), var(--glow-cyan);
  background: rgba(7, 18, 33, 1);
}

.search-input-box input::placeholder {
  color: var(--text-dim);
}

.clear-btn {
  position: absolute;
  right: 0.875rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  display: none;
}

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

/* Attention-pulse for search input when no site is selected */
@keyframes inputPulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); border-color: rgba(245, 158, 11, 0.6); }
  50%  { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); border-color: rgba(245, 158, 11, 0.9); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); border-color: rgba(56, 189, 248, 0.35); }
}

@media (prefers-reduced-motion: no-preference) {
  .input-pulse input {
    animation: inputPulse 0.6s ease 2;
  }
}

/* Sticky Selected-Site Quickbar */
.site-quickbar {
  position: sticky;
  top: 0.5rem;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.1rem;
  background: rgba(7, 19, 34, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.site-quickbar[hidden] {
  display: none;
}

.quickbar-site-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-wrap: wrap;
}

.quickbar-site-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.quickbar-status {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.quickbar-status.status-favourable {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.quickbar-status.status-caution {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.45);
}

.quickbar-status.status-unsuitable {
  background: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
  border-color: rgba(244, 63, 94, 0.45);
}

.quickbar-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.quickbar-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.quickbar-link:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--teal-glow);
  color: #ffffff;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #0f766e 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0.25rem 1rem rgba(2, 132, 199, 0.3);
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #115e59 100%);
  transform: translateY(-1px);
  box-shadow: 0 0.375rem 1.25rem rgba(14, 165, 233, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Loading Simulation State
   ========================================================================== */
.loading-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.15) 0%, rgba(20, 184, 166, 0.15) 100%);
  border: 1px solid var(--teal-primary);
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease;
}

.loading-banner.hidden {
  display: none;
}

.spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--teal-glow);
  border-radius: 50%;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .spinner {
    animation: spin 0.8s linear infinite;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-content h3 {
  font-size: 0.95rem;
  color: #ffffff;
  font-weight: 700;
}

.loading-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-0.375rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Elastic Dashboard Grid & Cards (12-Column Flexible Layout)
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.dash-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.dash-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg), 0 0 1.25rem rgba(14, 165, 233, 0.1);
}

/* Card Sizes across 12-column grid */
.card-interactive-map { grid-column: span 12; }
.card-verdict { grid-column: span 12; }
.card-conditions { grid-column: span 12; }
.card-tides { grid-column: span 12; }
.card-site-briefing { grid-column: span 12; }
.card-species { grid-column: span 12; width: 100%; }

/* Consolidated Hazard Warnings Block Inside Verdict Card */
.verdict-hazards-block {
  margin-top: 1.25rem;
  background: rgba(7, 19, 36, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.verdict-hazards-block .hazards-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
}

/* Card Header Common */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.875rem;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon.cyan {
  background: rgba(14, 165, 233, 0.15);
  color: var(--teal-glow);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.card-icon.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-icon.seafoam {
  background: rgba(45, 212, 191, 0.15);
  color: var(--seafoam);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.card-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-icon.teal {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.card-icon.map-accent {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
}

.data-source-pill, .tag-accent {
  font-size: 0.72rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
}

.tag-accent {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
  color: var(--seafoam);
  font-weight: 600;
}

/* ==========================================================================
   LARGE INTERACTIVE MAP (5. Explicit Viewport Height: 65vh)
   ========================================================================== */
.map-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.region-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(7, 19, 36, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.625rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.region-selector-wrap:hover,
.region-selector-wrap:focus-within {
  border-color: var(--teal-primary);
  box-shadow: 0 0 0.625rem rgba(14, 165, 233, 0.2);
}

.region-select-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-glow);
  white-space: nowrap;
}

.region-select-dropdown {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.125rem 0.25rem;
}

.region-select-dropdown option {
  background: #071322;
  color: var(--text-primary);
  padding: 0.375rem 0.625rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.shore-dot {
  background: var(--teal-glow);
  box-shadow: 0 0 0.5rem var(--teal-glow);
}

.legend-dot.boat-dot {
  background: var(--amber-alert);
  box-shadow: 0 0 0.5rem var(--amber-alert);
}

.legend-briefing-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #facc15;
  background: transparent;
  text-shadow: 0 0 0.45rem rgba(250, 204, 21, 0.85);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

/* Fluid Viewport Map Wrapper: Exactly 65vh across 1080p and 1440p */
.map-wrapper {
  position: relative;
  width: 100%;
  height: 65vh;
  min-height: 32rem;
  max-height: 75vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.6);
  background: #06111f;
}

#dive-map,
#map {
  width: 100%;
  height: 100%;
  min-height: 100%;
  z-index: 1;
}

/* Subtle dark treatment belongs only on the drawn street map. */
.leaflet-tile.street-map-tile {
  filter: brightness(0.85) contrast(1.1) saturate(1.15) hue-rotate(5deg);
}

.imagery-info-control {
  max-width: 22rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.35rem;
  background: rgba(6, 17, 31, 0.88);
  color: #f8fafc;
  box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.35);
  font-size: 0.72rem;
  line-height: 1.35;
}

.map-imagery-note {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.leaflet-container {
  background-color: #9ec8c8 !important;
  background: #9ec8c8 !important;
  font-family: inherit !important;
}

/* Coordinates & Routing Action Bar */
.coords-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.875rem;
  background: rgba(7, 19, 36, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.375rem;
}

.coords-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.coords-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  font-weight: 700;
}

.coords-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.02em;
}

.coords-dms {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.coords-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: var(--teal-glow);
  transform: translateY(-1px);
}

.btn-copy.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--emerald-accent);
  color: #34d399;
}

.nav-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-btn-sm.google-nav {
  background: rgba(66, 133, 244, 0.15);
  border: 1px solid rgba(66, 133, 244, 0.35);
  color: #93c5fd;
}

.nav-btn-sm.google-nav:hover {
  background: rgba(66, 133, 244, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-btn-sm.waze-nav {
  background: rgba(0, 214, 255, 0.15);
  border: 1px solid rgba(0, 214, 255, 0.35);
  color: #67e8f9;
}

.nav-btn-sm.waze-nav:hover {
  background: rgba(0, 214, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Custom Map Pins & Clusters
   ========================================================================== */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.custom-pin:hover {
  transform: scale(1.25);
}

.custom-pin.shore-pin {
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  border: 2px solid #5eead4;
  color: #ffffff;
  box-shadow: 0 0 0.875rem rgba(14, 165, 233, 0.6);
}

.custom-pin.boat-pin {
  background: linear-gradient(135deg, #d97706 0%, #dc2626 100%);
  border: 2px solid #fef08a;
  color: #ffffff;
  box-shadow: 0 0 0.875rem rgba(245, 158, 11, 0.6);
}

.custom-pin.active-pin {
  border-color: #ffffff !important;
  box-shadow: 0 0 1.25rem #38bdf8;
}

@media (prefers-reduced-motion: no-preference) {
  .custom-pin.active-pin {
    animation: activePinPulse 1.5s infinite alternate;
  }
}

@keyframes activePinPulse {
  from { transform: scale(1.15); box-shadow: 0 0 1rem #38bdf8; }
  to { transform: scale(1.35); box-shadow: 0 0 1.5rem #38bdf8; }
}

/* Cluster styling override */
.marker-cluster {
  background-clip: padding-box;
  border-radius: 50%;
}

.marker-cluster div {
  width: 2.125rem;
  height: 2.125rem;
  margin-left: 0.1875rem;
  margin-top: 0.1875rem;
  text-align: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: inherit;
}

.marker-cluster-small {
  background-color: rgba(14, 165, 233, 0.35) !important;
  border: 1px solid rgba(56, 189, 248, 0.6) !important;
}
.marker-cluster-small div {
  background-color: rgba(2, 132, 199, 0.85) !important;
}

.marker-cluster-medium {
  background-color: rgba(45, 212, 191, 0.35) !important;
  border: 1px solid rgba(45, 212, 191, 0.6) !important;
}
.marker-cluster-medium div {
  background-color: rgba(13, 148, 136, 0.85) !important;
}

.marker-cluster-large {
  background-color: rgba(245, 158, 11, 0.35) !important;
  border: 1px solid rgba(245, 158, 11, 0.6) !important;
}
.marker-cluster-large div {
  background-color: rgba(217, 119, 6, 0.85) !important;
}

/* Custom Leaflet Popup - Semi-Transparent Glass Effect */
.leaflet-popup-content-wrapper {
  background: rgba(7, 21, 40, 0.85) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 0.625rem 2rem rgba(0, 0, 0, 0.8), 0 0 1rem rgba(56, 189, 248, 0.15) !important;
  color: #f8fafc !important;
  padding: 0.25rem !important;
}

.leaflet-popup-tip {
  background: rgba(7, 21, 40, 0.85) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 0.375rem 1rem rgba(0, 0, 0, 0.6) !important;
}

.map-popup-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  min-width: 14rem;
}

.popup-title {
  display: list-item;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.8);
  text-underline-offset: 0.2rem;
}

.popup-title:hover,
.popup-title:focus-visible {
  color: #7dd3fc;
}

.popup-description {
  margin-top: 0.55rem;
  color: #dbeafe;
  font-size: 0.78rem;
  line-height: 1.45;
}

.popup-source,
.popup-source-unavailable {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.68rem;
}

.popup-source {
  color: #7dd3fc !important;
}

.popup-source-unavailable {
  color: #94a3b8;
}

.popup-location {
  color: #cbd5e1;
  font-size: 0.76rem;
}

.popup-meta-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.popup-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.popup-badge.shore-badge {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.popup-badge.boat-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.popup-dist {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--seafoam-light);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.45rem;
  font-weight: 600;
}

.popup-coords {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--seafoam-light);
  background: rgba(4, 12, 24, 0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.popup-region {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.site-info-star {
  color: #facc15;
  font-size: 1em;
  font-weight: 900;
  text-shadow: 0 0 0.45rem rgba(250, 204, 21, 0.85);
}

/* Smooth Fade-in Transition for Leaflet Tooltips */
.leaflet-tooltip {
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  opacity: 0.8 !important;
}

/* Dark, Semi-Transparent Theme for Dive Site Tooltips */
.leaflet-tooltip.dark-tooltip,
.leaflet-tooltip.site-label {
  background: rgba(6, 17, 31, 0.88) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: var(--radius-sm, 6px) !important;
  box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, 0.65), 0 0 0.5rem rgba(14, 165, 233, 0.2) !important;
  color: #f8fafc !important;
  font-family: inherit !important;
  padding: 0.35rem 0.65rem !important;
  pointer-events: none;
  text-align: center;
  line-height: 1.35;
}

.leaflet-tooltip.dark-tooltip::before,
.leaflet-tooltip.site-label::before {
  border-top-color: rgba(6, 17, 31, 0.88) !important;
  border-bottom-color: rgba(6, 17, 31, 0.88) !important;
}

.custom-tooltip strong {
  color: #f8fafc;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.custom-tooltip span {
  display: inline-block;
  margin-top: 0.15rem;
}

/* ==========================================================================
   Leaflet Custom Fullscreen Control
   ========================================================================== */
#dive-map:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}

#dive-map:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}

.leaflet-control-fullscreen {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  border-radius: 4px;
}

.leaflet-control-fullscreen a {
  background-color: #ffffff;
  color: #0f172a;
  width: 1.625rem;
  height: 1.625rem;
  line-height: 1.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.leaflet-control-fullscreen a:hover,
.leaflet-control-fullscreen a:focus {
  background-color: #f4f4f4;
  color: #0284c7;
}

.leaflet-control-fullscreen .fullscreen-icon {
  display: inline-block;
  line-height: 1;
}

.leaflet-touch .leaflet-control-fullscreen a {
  width: 1.875rem;
  height: 1.875rem;
  line-height: 1.875rem;
  font-size: 1.05rem;
  border-radius: 2px;
}

/* Leaflet Live Zoom Level & Approximate Altitude Indicator */
.leaflet-zoom-indicator {
  background: rgba(6, 17, 31, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
  margin-bottom: 0.5rem;
  margin-left: 0.5rem;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   4. Proportional UI: Wikivoyage Coastal Dive Guide Resource Banner
   ========================================================================== */
.resource-banner {
  grid-column: span 12;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(20, 184, 166, 0.05) 50%, rgba(13, 30, 53, 0.65) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  margin-top: -0.375rem;
  margin-bottom: -0.375rem;
}

.resource-banner:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0.375rem 1.5rem rgba(14, 165, 233, 0.15), var(--shadow-md);
  transform: translateY(-1px);
}

.resource-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.resource-icon-badge {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--teal-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0.625rem rgba(14, 165, 233, 0.2);
}

.resource-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.resource-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--seafoam-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.resource-link:hover {
  color: var(--teal-glow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.resource-link svg {
  color: var(--teal-glow);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.resource-link:hover svg {
  transform: translate(2px, -2px);
}

.resource-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(7, 19, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
}

.resource-tag-pill .pill-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--seafoam);
  box-shadow: 0 0 0.375rem var(--seafoam);
  flex-shrink: 0;
}

/* ==========================================================================
   Card 1: Conditions Metric Grid (Elastic Auto-Fitting Grid)
   ========================================================================== */
.conditions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
  gap: 1rem;
}

.metric-box {
  background: rgba(7, 19, 36, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: all 0.2s ease;
}

.metric-box:hover {
  background: rgba(10, 27, 51, 0.8);
  border-color: rgba(56, 189, 248, 0.3);
}

.metric-box.alert-box {
  border-color: var(--border-amber);
  background: rgba(245, 158, 11, 0.05);
}

.metric-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.metric-val {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.metric-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-val.alert-text {
  color: #fbbf24;
}

.metric-val.cold-text {
  color: #38bdf8;
}

.metric-sub {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.indicator-arrow {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--teal-glow);
  font-weight: bold;
  transition: transform 0.3s ease;
}

.alert-badge {
  color: #fbbf24;
  font-weight: 600;
}

.metric-note {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.safe-warning {
  color: #38bdf8;
}

/* ==========================================================================
   Card 2: Verdict & Decision Matrix (Full-Width Streamlined Card)
   ========================================================================== */
.verdict-banner-container {
  width: 100%;
}

.verdict-banner {
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
  border-left: 6px solid var(--emerald-accent);
  transition: all 0.3s ease;
}

.verdict-banner.go-atlantic {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 6px solid var(--emerald-accent);
}

.verdict-banner.go-falsebay {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-left: 6px solid var(--teal-primary);
}

.verdict-banner.blown-out {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(245, 158, 11, 0.12) 100%);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-left: 6px solid var(--rose-danger);
}

.verdict-banner.caution {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(234, 179, 8, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-left: 6px solid var(--amber-alert);
}

.verdict-banner.caution .verdict-flag {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.22);
}

.verdict-disclaimer {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.dive-disclosure {
  margin-top: 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(7, 19, 36, 0.55);
  overflow: hidden;
}

.dive-disclosure[hidden] {
  display: none;
}

.dive-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  list-style: none;
  user-select: none;
}

.dive-disclosure-summary::-webkit-details-marker {
  display: none;
}

.dive-disclosure-summary::after {
  content: "▸";
  font-size: 0.9rem;
  color: var(--teal-glow);
  margin-left: auto;
  transition: transform 0.2s ease;
}

.dive-disclosure[open] > .dive-disclosure-summary::after {
  transform: rotate(90deg);
}

.disclosure-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.dive-disclosure-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dive-disclosure-body .hazards-list,
.dive-disclosure-body .gear-checklist {
  margin-top: 0.85rem;
}

.gear-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.gear-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(7, 19, 36, 0.65);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.gear-checkbox {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--emerald-accent);
  flex-shrink: 0;
  cursor: pointer;
}

.gear-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gear-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gear-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.gear-item input:checked + .gear-text .gear-title {
  color: var(--seafoam-light);
}

.gear-note {
  margin-top: 0.75rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.verdict-banner.awaiting-selection {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-left: 6px solid var(--text-dim);
}

.verdict-banner.awaiting-selection .verdict-flag {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.15);
}

.verdict-flag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.verdict-banner.blown-out .verdict-flag {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.2);
}

.verdict-main {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin-bottom: 0.625rem;
}

.verdict-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Marine Life Spotting (Top 5 Local Sightings - iNaturalist)
   ========================================================================== */
.species-wrapper {
  width: 100%;
}

.species-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.species-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
}

.species-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  letter-spacing: 0.01em;
}

.species-container {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(6, 17, 31, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.species-placeholder {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-style: italic;
  margin: 0 auto;
  text-align: center;
}

.species-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #38bdf8;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 1rem 0;
  margin: 0 auto;
}

.species-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 2.5px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
  .species-spinner {
    animation: speciesSpin 0.75s linear infinite;
  }
}

@keyframes speciesSpin {
  to { transform: rotate(360deg); }
}

.species-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.species-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: rgba(8, 22, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0.35rem 1.25rem rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.species-card:hover {
  background: rgba(14, 32, 60, 0.95);
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.6), 0 0 1rem rgba(14, 165, 233, 0.25);
}

.species-thumb-box {
  width: 100%;
  height: 175px; /* Large card-sized tile around 150px - 200px tall */
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(56, 189, 248, 0.2);
  margin-bottom: 0.75rem;
}

.species-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.species-card:hover .species-thumb {
  transform: scale(1.05);
}

.species-thumb-fallback {
  font-size: 3.5rem;
  line-height: 1;
}

.species-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.25rem 0.25rem 0.5rem;
  gap: 0.3rem;
}

.species-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.species-latin {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Custom Site Label Tooltips for Map Pins */
.leaflet-tooltip.site-label {
  background: rgba(6, 17, 31, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  box-shadow: 0 0.25rem 0.875rem rgba(0, 0, 0, 0.6), 0 0 0.625rem rgba(14, 165, 233, 0.25);
  white-space: nowrap;
  pointer-events: none;
}

.leaflet-tooltip-top.site-label::before {
  border-top-color: rgba(56, 189, 248, 0.45);
}

/* Empty State & Disabled link utility */
.empty-state-msg {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.75rem 0;
}

.disabled-link {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* ==========================================================================
   Card 4: Hazards List
   ========================================================================== */
.hazards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hazard-entry {
  display: flex;
  gap: 0.875rem;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: rgba(7, 19, 36, 0.6);
}

.hazard-entry.level-critical {
  background: rgba(244, 63, 94, 0.07);
  border-color: rgba(244, 63, 94, 0.28);
}

.hazard-entry.level-warning {
  background: rgba(14, 165, 233, 0.07);
  border-color: rgba(14, 165, 233, 0.28);
}

.hazard-entry.level-caution {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.28);
}

.hazard-icon-box {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.level-critical .hazard-icon-box {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.level-warning .hazard-icon-box {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

.level-caution .hazard-icon-box {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.hazard-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hazard-headline {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

.hazard-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}


/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 0 0;
  margin-top: 0.75rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-attribution {
  color: var(--text-muted);
}

/* ==========================================================================
   Dive Planner Time-Selector Widget & Controls
   ========================================================================== */
.planner-panel {
  background: rgba(4, 14, 28, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.planner-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.planner-icon-badge {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm, 6px);
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--teal-glow, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

.planner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.planner-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim, #94a3b8);
  display: block;
}

.planner-controls-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.planner-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.planner-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.planner-date-input,
.planner-time-select {
  background: rgba(10, 25, 47, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #ffffff;
  color-scheme: dark;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.planner-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #bae6fd;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.planner-mode-pill.is-forecast {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.planner-date-input:focus,
.planner-time-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.planner-reset-btn {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.planner-reset-btn:hover {
  background: rgba(14, 165, 233, 0.3);
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* Primary action — Forecast Window */
.planner-search-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(14, 165, 233, 0.16) 100%);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #34d399;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  white-space: nowrap;
}

.planner-search-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(14, 165, 233, 0.3) 100%);
  color: #ffffff;
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.planner-search-btn:active {
  transform: translateY(0);
}

.planner-search-btn.loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* No-site toast nudge */
.planner-no-site-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 9999;
  background: rgba(7, 19, 36, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: var(--radius-md, 8px);
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fbbf24;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

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

/* ==========================================================================
   Dedicated Standalone Section: Tide Table & Water Level
   ========================================================================== */
.card-tides {
  grid-column: span 12;
  width: 100%;
}

.tide-table-content {
  width: 100%;
  font-family: var(--font-mono, monospace);
}

.tide-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.75rem 0;
  font-family: var(--font-stack);
}

.tide-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.tide-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tide-label-dim {
  font-size: 0.8rem;
  color: var(--text-dim, #94a3b8);
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-right: 0.5rem;
}

.tide-val-live {
  font-size: 1.5rem;
  font-weight: 800;
}

.tide-status-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full, 9999px);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tide-status-pill.rising {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.tide-status-pill.falling {
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}

.tide-target-highlight {
  background: rgba(56, 189, 248, 0.1);
  border: 1px dashed rgba(56, 189, 248, 0.5);
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  color: #ffffff;
}

.highlight-flag {
  color: #38bdf8;
  font-weight: 800;
}

.highlight-val {
  color: #ffffff;
  font-weight: 800;
}

.highlight-time {
  color: #94a3b8;
}

.tide-block-title {
  font-size: 0.74rem;
  color: var(--text-dim, #94a3b8);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Rolling Timeline Table */
.tide-timeline-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0.65rem;
}

.tide-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.86rem;
  transition: all 0.2s ease;
}

/* Dimmed historical entries */
.tide-row.past {
  opacity: 0.55;
  background: rgba(4, 12, 24, 0.45);
  color: #94a3b8;
  border: 1px solid transparent;
}

.tide-row.past:hover {
  opacity: 0.85;
  background: rgba(10, 25, 47, 0.6);
}

/* Bright accent border highlighting current time row */
.tide-row.current {
  opacity: 1;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  color: #ffffff;
  font-weight: 700;
}

/* Forecast future rows — teal-tinted with dashed border */
.tide-row.future {
  opacity: 0.85;
  background: rgba(20, 184, 166, 0.07);
  border: 1px dashed rgba(45, 212, 191, 0.3);
  color: #cbd5e1;
}

.tide-row.future:hover {
  opacity: 1;
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(45, 212, 191, 0.55);
}

.tide-cell-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tide-time-label {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tide-badge-now {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.125rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
}

.tide-badge-past {
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Future forecast hour badge */
.tide-badge-future {
  background: rgba(45, 212, 191, 0.15);
  color: #5eead4;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(45, 212, 191, 0.35);
}

.tide-cell-height {
  font-weight: 700;
}

.height-pos {
  color: #38bdf8;
}

.height-neg {
  color: #67e8f9;
}

.tide-cell-trend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  justify-self: end;
}

.tide-arrow {
  color: var(--teal-glow, #38bdf8);
  font-weight: bold;
}

/* Next 4 Inflection Points Grid */
.tide-inflection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.inflection-pill {
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inflection-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.inflection-pill.pill-high {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.inflection-pill.pill-low {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.inf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pill-high .inf-type {
  color: #38bdf8;
}

.pill-low .inf-type {
  color: #fbbf24;
}

.inf-seq {
  color: var(--text-dim, #94a3b8);
  font-size: 0.68rem;
}

.inf-time {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 0.1rem;
}

.inf-height {
  font-size: 0.84rem;
  font-weight: 700;
}

.inf-cue {
  font-size: 0.66rem;
  color: var(--text-secondary, #cbd5e1);
  margin-top: 0.15rem;
  line-height: 1.25;
}
.data-provenance {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.provenance-live {
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
}

.provenance-cached {
  border-color: rgba(251, 191, 36, 0.65);
  color: #fde68a;
}

.provenance-unavailable {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

/* ========================================================================== 
   Sourced Dive Site Briefing
   ========================================================================== */
.site-briefing-badge {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 999px;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-briefing-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.briefing-condition-matches {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.briefing-condition-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.briefing-condition-heading h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 1rem;
}

.briefing-condition-heading span {
  color: var(--text-dim, #94a3b8);
  font-size: 0.72rem;
}

.briefing-condition-alert {
  padding: 0.9rem 1rem;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--radius-md);
}

.briefing-condition-alert strong,
.briefing-condition-alert p,
.briefing-condition-alert small {
  display: block;
}

.briefing-condition-alert p {
  margin: 0.3rem 0 0;
  line-height: 1.45;
}

.briefing-condition-alert small {
  margin-top: 0.4rem;
  opacity: 0.82;
  line-height: 1.35;
}

.condition-alert-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.condition-warning {
  border-color: rgba(245, 158, 11, 0.62);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.08);
}

.condition-critical {
  border-color: rgba(244, 63, 94, 0.72);
  background: rgba(244, 63, 94, 0.16);
  color: #fecdd3;
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.12);
}

.condition-neutral {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.07);
  color: #bae6fd;
}

.site-briefing-placeholder,
.site-briefing-empty {
  margin: 0;
  padding: 1rem;
  color: var(--text-secondary, #cbd5e1);
  background: rgba(15, 23, 42, 0.52);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
}

.site-briefing-empty p {
  margin: 0.35rem 0 0;
}

.briefing-safety-callout {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.08);
}

.briefing-feature-note {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: var(--radius-md);
  background: rgba(20, 184, 166, 0.08);
}

.briefing-feature-note p {
  margin: 0;
  color: #ccfbf1;
  line-height: 1.5;
}

.briefing-kicker {
  display: block;
  margin-bottom: 0.35rem;
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.briefing-safety-callout p,
.briefing-panel p,
.briefing-panel ul,
.site-briefing-footer p {
  margin: 0;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.55;
}

.site-briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.briefing-panel {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  background: rgba(7, 19, 36, 0.5);
}

.briefing-panel-route {
  border-color: rgba(56, 189, 248, 0.3);
}

.briefing-panel-caution {
  border-color: rgba(245, 158, 11, 0.3);
}

.briefing-panel-wide {
  grid-column: 1 / -1;
}

.briefing-panel h3 {
  margin: 0 0 0.55rem;
  color: #f8fafc;
  font-size: 0.9rem;
}

.briefing-panel ul {
  padding-left: 1.1rem;
}

.briefing-panel li + li {
  margin-top: 0.35rem;
}

.site-briefing-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text-dim, #94a3b8);
  font-size: 0.72rem;
}

.site-briefing-footer p {
  flex: 1 1 100%;
  color: #fbbf24;
}

.site-briefing-footer .briefing-review-note {
  flex: 1 1 100%;
  color: var(--text-secondary, #cbd5e1);
}

.site-briefing-footer a {
  color: #7dd3fc;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app-container {
    width: 98vw;
    padding: 1rem 0.85rem 2.5rem;
  }

  .main-header {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  .app-container {
    width: 100%;
    padding: 0.75rem 0.65rem 2rem;
    gap: 1.1rem;
  }

  .main-header,
  .search-card,
  .dash-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .map-wrapper {
    height: 52vh;
    min-height: 20rem;
    max-height: 28rem;
  }

  .coords-bar {
    padding: 0.85rem;
  }

  .coords-actions {
    width: 100%;
  }

  .planner-panel {
    padding: 0.85rem;
  }

  .planner-controls-row {
    width: 100%;
    gap: 0.6rem;
  }

  .planner-field {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .planner-date-input,
  .planner-time-select {
    flex: 1 1 auto;
    max-width: 65%;
  }

  .conditions-grid {
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.75rem;
  }

  .site-quickbar {
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
  }

  .quickbar-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }

  .quickbar-link {
    white-space: nowrap;
  }

  .site-briefing-grid {
    grid-template-columns: 1fr;
  }

  .briefing-panel-wide {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .search-input-box {
    min-width: 0;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .conditions-grid,
  .gear-checklist {
    grid-template-columns: 1fr;
  }

  .tide-timeline-container {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .btn-primary,
  .btn-copy,
  .nav-btn-sm,
  .theme-toggle-btn,
  .planner-date-input,
  .planner-time-select,
  .planner-reset-btn,
  .region-select-dropdown,
  .quickbar-link,
  .dive-disclosure-summary {
    min-block-size: 44px;
  }

  .clear-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ==========================================================================
   Daylight / High-Contrast Light Mode (Outdoor Sunlight Readability)
   ========================================================================== */
:root:has(> head > meta[name="color-scheme"][content="light"]),
:root[data-theme="light"] {
  color-scheme: light;
  --bg-abyss: #eef4f8;
  --bg-deep: #e2ecf4;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;
  --focus-ring: #0369a1;
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-dim: #475569;
  --teal-glow: #0369a1;
  --seafoam: #0f766e;
  --seafoam-light: #0f766e;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] body {
  background-color: #eef4f8;
  background-image: linear-gradient(180deg, #e7f0f7 0%, #f8fafc 100%);
  color: #0f172a;
}

:root[data-theme="light"] .brand-title {
  background: none;
  -webkit-text-fill-color: #0f172a;
  color: #0f172a;
}

:root[data-theme="light"] .card-title,
:root[data-theme="light"] .metric-val,
:root[data-theme="light"] .verdict-main,
:root[data-theme="light"] .hazard-headline,
:root[data-theme="light"] .planner-title,
:root[data-theme="light"] .briefing-condition-heading h3,
:root[data-theme="light"] .briefing-panel h3,
:root[data-theme="light"] .species-name,
:root[data-theme="light"] .inf-time,
:root[data-theme="light"] .resource-link,
:root[data-theme="light"] .highlight-val {
  color: #0f172a;
}

:root[data-theme="light"] .metric-val.cold-text {
  color: #0369a1;
}

:root[data-theme="light"] .metric-val.alert-text {
  color: #b45309;
}

:root[data-theme="light"] .search-input-box input,
:root[data-theme="light"] .planner-date-input,
:root[data-theme="light"] .planner-time-select {
  background: #f8fafc;
  color: #0f172a;
  color-scheme: light;
  border-color: #94a3b8;
}

:root[data-theme="light"] .region-selector-wrap,
:root[data-theme="light"] .coords-bar,
:root[data-theme="light"] .planner-panel,
:root[data-theme="light"] .metric-box,
:root[data-theme="light"] .dive-disclosure,
:root[data-theme="light"] .gear-item,
:root[data-theme="light"] .hazard-entry,
:root[data-theme="light"] .briefing-panel,
:root[data-theme="light"] .species-container,
:root[data-theme="light"] .species-card,
:root[data-theme="light"] .site-briefing-empty,
:root[data-theme="light"] .site-briefing-placeholder {
  background: #f8fafc;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .region-select-dropdown option {
  background: #ffffff;
  color: #0f172a;
}

:root[data-theme="light"] .site-quickbar {
  background: rgba(255, 255, 255, 0.96);
  border-color: #0284c7;
}

:root[data-theme="light"] .quickbar-link {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

:root[data-theme="light"] .quickbar-status {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #7dd3fc;
}

:root[data-theme="light"] .quickbar-status.status-favourable {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

:root[data-theme="light"] .quickbar-status.status-caution {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

:root[data-theme="light"] .quickbar-status.status-unsuitable {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}

:root[data-theme="light"] .btn-copy,
:root[data-theme="light"] .planner-reset-btn,
:root[data-theme="light"] .nav-btn-sm.google-nav,
:root[data-theme="light"] .nav-btn-sm.waze-nav,
:root[data-theme="light"] .planner-mode-pill {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0c4a6e;
}

:root[data-theme="light"] .data-provenance {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

:root[data-theme="light"] .data-provenance.provenance-live {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

:root[data-theme="light"] .data-provenance.provenance-cached {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

:root[data-theme="light"] .data-provenance.provenance-unavailable {
  background: #fff1f2;
  border-color: #f43f5e;
  color: #9f1239;
}

:root[data-theme="light"] .verdict-banner.go-atlantic {
  background: #ecfdf5;
  border-color: #10b981;
}

:root[data-theme="light"] .verdict-banner.go-falsebay {
  background: #eff6ff;
  border-color: #0284c7;
}

:root[data-theme="light"] .verdict-banner.caution {
  background: #fffbeb;
  border-color: #f59e0b;
}

:root[data-theme="light"] .verdict-banner.blown-out {
  background: #fff1f2;
  border-color: #f43f5e;
}

:root[data-theme="light"] .verdict-banner.awaiting-selection {
  background: #f1f5f9;
  border-color: #94a3b8;
}

:root[data-theme="light"] .verdict-flag {
  color: #065f46;
  background: #d1fae5;
}

:root[data-theme="light"] .verdict-banner.caution .verdict-flag {
  color: #92400e;
  background: #fde68a;
}

:root[data-theme="light"] .verdict-banner.blown-out .verdict-flag {
  color: #9f1239;
  background: #fecdd3;
}

:root[data-theme="light"] .tide-row.past {
  background: #f1f5f9;
  color: #475569;
}

:root[data-theme="light"] .tide-row.current {
  background: #e0f2fe;
  color: #0f172a;
}

:root[data-theme="light"] .tide-row.future {
  background: #f0fdfa;
  color: #0f172a;
}

:root[data-theme="light"] .height-pos,
:root[data-theme="light"] .height-neg,
:root[data-theme="light"] .coords-value,
:root[data-theme="light"] .highlight-flag {
  color: #0369a1;
}

:root[data-theme="light"] .alert-badge {
  color: #b45309;
}

:root[data-theme="light"] .condition-warning {
  background: #fffbeb;
  color: #78350f;
}

:root[data-theme="light"] .condition-critical {
  background: #fff1f2;
  color: #881337;
}

:root[data-theme="light"] .condition-neutral {
  background: #eff6ff;
  color: #1e3a8a;
}

:root[data-theme="light"] .briefing-feature-note p {
  color: #115e59;
}

:root[data-theme="light"] .briefing-kicker {
  color: #b45309;
}

:root[data-theme="light"] .site-briefing-footer p {
  color: #92400e;
}

:root[data-theme="light"] .site-briefing-footer a {
  color: #0369a1;
}

:root[data-theme="light"] .leaflet-tile.street-map-tile {
  filter: none;
}

:root[data-theme="light"] .status-badge .status-text {
  color: #065f46;
}

:root[data-theme="light"] .status-badge.airgap-badge .status-text {
  color: #0369a1;
}

:root[data-theme="light"] .status-badge.status-idle .status-text {
  color: #334155;
}

:root[data-theme="light"] .status-badge.status-cached .status-text {
  color: #92400e;
}

:root[data-theme="light"] .status-badge.status-unavailable .status-text {
  color: #9f1239;
}
