/* ================================================
   MOI J'NAGE - SINGLE SOURCE OF TRUTH STYLESHEET
   ================================================ */

/* CSS Variables */
:root {
  --bg: #0b0d10;
  --panel: #0f1217;
  --text: #e8edf2;
  --muted: #9aa7b5;
  --line: rgba(255,255,255,.08);
  --chip: rgba(255,255,255,.06);
}

/* Base Styles */
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#app {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 380px;
}

#map {
  height: 100%;
  position: relative;
}

/* Minimal scale control styling */
.leaflet-control-scale {
  margin: 10px !important;
}

.leaflet-control-scale-line {
  background: transparent;
  border: none;
  border-top: 2px solid #333;
  color: #333;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 0 0;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.9);
  box-shadow: none;
  line-height: 1;
}

.leaflet-control-scale-line:not(:first-child) {
  display: none;
}

#panel {
  border-left: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 40%), var(--panel);
  padding: 24px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: auto;
  /* Subtle layered shadow for premium elevated feel */
  box-shadow: 
    -1px 0 0 rgba(255,255,255,0.04),
    -4px 0 16px rgba(0,0,0,0.15),
    -12px 0 40px rgba(0,0,0,0.25);
}

h2 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }
h3 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }

.logo-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.logo {
  max-height: 72px;
  max-width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.muted { color: var(--muted); font-size: 12px; line-height: 1.4; opacity: 0.85; }
.sidebar-hint { font-size: 11px; margin-top: 14px; color: var(--muted); opacity: 0.7; }
hr { border: 0; border-top: 1px solid rgba(255,255,255,0.04); margin: 20px 0; }

a.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,.03);
  margin-top: 12px;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}
a.btn:hover { border-color: rgba(255,255,255,0.16); background: rgba(255,255,255,.06); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.chip {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 4px;
  background: var(--chip);
  font-size: 11px;
  color: var(--muted);
}

/* =============================================
   LEGEND STYLES
   ============================================= */

/* Legend - Desktop (HIDDEN by UI v2) */
.legend-control {
  display: none;
  background: rgba(15, 18, 23, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 10px;
  font-family: system-ui, sans-serif;
  font-size: 11px;
}

.legend-desktop {
  display: none;
  flex-wrap: wrap;
  gap: 12px 16px;
  max-width: calc(100vw - 420px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #ffffff;
}

.legend-desktop .legend-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}

/* Legend - Mobile Overlay (Floating Button) */
.legend-toggle {
  display: none;
  background: rgba(15, 18, 23, 0.95);
  border: 1px solid var(--line);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  gap: 10px;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
}

/* Legend - Mobile Bottom Sheet */
.legend-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2400;
}

.legend-bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  z-index: 2500;
  height: min(70vh, 520px);
  flex-direction: column;
  /* Subtle layered shadow for modal feel */
  box-shadow: 
    0 -1px 0 rgba(255,255,255,0.05),
    0 -4px 16px rgba(0,0,0,0.25),
    0 -12px 48px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend-bottom-sheet.active {
  display: flex;
  transform: translateY(0);
}

.legend-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.legend-sheet-title {
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.legend-sheet-close {
  padding: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}

.legend-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}

.legend-sheet-footer {
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.legend-mobile-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.legend-mobile-item:active {
  background: rgba(255,255,255,0.08);
}

.legend-mobile-item span {
  font-size: 13px;
  color: #ffffff;
  font-family: system-ui, sans-serif;
}

/* =============================================
   SIDEBAR LEGEND (UI v2)
   ============================================= */

.sidebar-legend-container {
  margin-bottom: 10px;
}

.sidebar-legend-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-legend-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.sidebar-legend-panel {
  margin-top: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.sidebar-legend-list {
  padding: 8px 0;
}

.sidebar-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-legend-item:hover {
  background: rgba(255,255,255,0.05);
}

.sidebar-legend-reset {
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

/* =============================================
   FILTER STYLES
   ============================================= */

/* Filter - Mobile Only */
.filter-toggle {
  display: none;
  background: rgba(15, 18, 23, 0.95);
  border: 1px solid var(--line);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  gap: 10px;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.filter-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2400;
}

.filter-bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  z-index: 2500;
  max-height: min(70vh, 520px);
  flex-direction: column;
  /* Subtle layered shadow for modal feel */
  box-shadow: 
    0 -1px 0 rgba(255,255,255,0.05),
    0 -4px 16px rgba(0,0,0,0.25),
    0 -12px 48px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-bottom-sheet.active {
  display: flex;
  transform: translateY(0);
}

.filter-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.filter-sheet-title {
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.filter-sheet-close {
  padding: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}

.filter-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  font-family: system-ui, sans-serif;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: system-ui, sans-serif;
}

.filter-chip.active {
  background: rgba(78, 168, 222, 0.2);
  border-color: #4EA8DE;
  color: #ffffff;
}

.filter-sheet-footer {
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.filter-reset-btn {
  width: 100%;
  padding: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}

.filter-reset-btn:active {
  background: rgba(255,255,255,0.1);
}

/* Desktop Filter UI */
.filter-desktop-container {
  position: relative;
  margin-bottom: 10px;
}

.filter-desktop-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: all 0.15s;
}

.filter-desktop-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.filter-desktop-btn.filter-active {
  border-color: #4EA8DE;
  background: rgba(78, 168, 222, 0.15);
}

.filter-toggle.filter-active {
  border-color: #4EA8DE;
  background: rgba(78, 168, 222, 0.2);
}

.filter-desktop-overlay {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 100;
  flex-direction: column;
  max-height: 320px;
}

.filter-desktop-overlay.active {
  display: flex;
}

.filter-desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.filter-desktop-title {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  font-family: system-ui, sans-serif;
}

.filter-desktop-close {
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 4px;
}

.filter-desktop-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.filter-desktop-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.filter-desktop-footer .filter-reset-btn {
  padding: 10px;
  font-size: 13px;
}

/* =============================================
   SEARCH STYLES
   ============================================= */

.search-container {
  position: relative;
  margin-bottom: 12px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 36px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 13px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  outline: none;
  box-sizing: border-box;
}

.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,.05);
}

.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  display: none;
}

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

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.search-dropdown.active { display: block; }

.search-result {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(255,255,255,.06); }

.search-result-name {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.search-result-meta {
  font-size: 12px;
  color: var(--muted);
}

.search-result-external {
  color: #4EA8DE;
  font-style: italic;
}

.search-no-results {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.search-section-label {
  padding: 8px 14px 4px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}

.search-result-place .search-result-name {
  color: #4EA8DE;
}

/* Temporary search marker */
.temp-marker-icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Marker highlight effect */
.marker-highlighted {
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.8)) drop-shadow(0 0 16px rgba(255,255,255,0.4));
  z-index: 1000 !important;
  transform: scale(1.1);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.marker-dimmed {
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

/* =============================================
   LEAFLET TWEAKS
   ============================================= */

.leaflet-control-zoom a {
  background: rgba(15,18,23,.95);
  color: #ffffff;
  border: 1px solid var(--line);
}

.leaflet-control-zoom a:hover { background: rgba(255,255,255,.1); }
.leaflet-bar { box-shadow: none; }

/* =============================================
   MARKER STYLES
   ============================================= */

.custom-pin-icon { background: transparent !important; border: none !important; }

.marker-container {
  position: relative;
  width: 32px;
  height: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.marker-container svg.pin-shape { position: absolute; top: 0; left: 0; z-index: 1; }

.swimmer-icon {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
  z-index: 2;
}

/* =============================================
   SITE CARD & BUTTONS
   ============================================= */

.site-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 22px 24px 24px;
  margin-top: 8px;
  /* Subtle elevation - raised card feel */
  box-shadow: 
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 2px 8px rgba(0,0,0,0.12),
    0 4px 16px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.site-card-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.site-card-close:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}

.site-card h3 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text);
}

.site-card .muted,
.site-card .info-line {
  font-size: 12px;
  color: var(--muted);
}

.site-card .chips {
  margin: 14px 0 18px;
}

.action-btn {
  display: block;
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  margin-top: 8px;
}

/* Primary Button - "Accès & informations" - STRONGEST visual weight */
.btn-site-primary {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(180deg, #2A6575 0%, #1D4E5C 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e8f4f8;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  margin-top: 16px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  /* Subtle elevation for primary action */
  box-shadow: 
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 2px 4px rgba(0,0,0,0.2),
    0 4px 12px rgba(29, 78, 92, 0.25);
}

.btn-site-primary:hover {
  background: linear-gradient(180deg, #357A8A 0%, #265D6C 100%);
  box-shadow: 
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 4px 8px rgba(0,0,0,0.25),
    0 6px 16px rgba(29, 78, 92, 0.35);
  transform: translateY(-1px);
}

/* Secondary Buttons - "Itinéraire", "Vidéo" - softer, no elevation */
.btn-site-secondary {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  margin-top: 8px;
  transition: all 0.15s ease;
  box-sizing: border-box;
  /* No elevation - flat appearance */
}

.btn-site-secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}

/* Tertiary Button - "Suivre" - smallest visual weight, emotional action */
.subscribe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.15s ease;
  /* Minimal presence - does not compete with primary */
}

.subscribe-btn:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: var(--text);
}

.subscribe-btn.subscribed {
  background: rgba(46,125,50,0.12);
  border-color: rgba(46,125,50,0.25);
  color: #81c784;
}

.site-info-lines {
  margin-bottom: 14px;
}

.info-line {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* =============================================
   COMMUNITY FEATURE STYLES
   ============================================= */

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.user-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 12px;
  padding-top: 4px;
}

.user-account-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: -6px -10px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.user-account-info:hover {
  background: rgba(255,255,255,0.04);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-pseudo {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

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

.login-btn {
  background: linear-gradient(135deg, rgba(78, 168, 222, 0.2), rgba(107, 92, 246, 0.15));
  border: 1px solid rgba(78, 168, 222, 0.5);
  color: #6DD3FF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 10px;
  min-height: 44px;
  min-width: 44px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(78, 168, 222, 0.15);
}

.login-btn:hover {
  background: linear-gradient(135deg, rgba(78, 168, 222, 0.3), rgba(107, 92, 246, 0.25));
  border-color: rgba(78, 168, 222, 0.7);
  box-shadow: 0 4px 12px rgba(78, 168, 222, 0.25);
  transform: translateY(-1px);
}

.mes-sites-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(78, 168, 222, 0.1);
  border: 1px solid rgba(78, 168, 222, 0.3);
  border-radius: 12px;
  cursor: pointer;
  color: #4EA8DE;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.mes-sites-nav:hover {
  background: rgba(78, 168, 222, 0.2);
  border-color: rgba(78, 168, 222, 0.5);
}

.community-btn {
  background: linear-gradient(135deg, rgba(107, 92, 246, 0.15), rgba(78, 168, 222, 0.15));
  border: 1px solid rgba(107, 92, 246, 0.3);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.community-btn:hover {
  background: linear-gradient(135deg, rgba(107, 92, 246, 0.25), rgba(78, 168, 222, 0.25));
  border-color: rgba(107, 92, 246, 0.5);
}

.community-container {
  height: 100%;
  overflow-y: auto;
}

.community-screen {
  padding: 20px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  /* Gentle elevation for modal/auth screens */
  box-shadow: 
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 4px 20px rgba(0,0,0,0.15),
    0 8px 32px rgba(0,0,0,0.1);
}

.community-back-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.community-back-btn:hover {
  color: var(--text);
}

.community-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.community-benefits {
  margin: 0 0 24px 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.community-benefits li {
  margin-bottom: 4px;
}

.community-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #4EA8DE, #6B5CF6);
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(78, 168, 222, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  color: var(--muted);
}

.form-group input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: #4EA8DE;
  background: rgba(78, 168, 222, 0.05);
}

.form-error {
  color: #EF476F;
  font-size: 13px;
  min-height: 18px;
}

.form-message {
  font-size: 13px;
  min-height: 18px;
  color: var(--muted);
}

.form-message.success {
  color: #06D6A0;
}

.auth-forgot {
  text-align: center;
  margin: 8px 0 16px;
}

.auth-forgot a {
  color: var(--muted);
  font-size: 13px;
}

.auth-forgot a:hover {
  color: var(--text);
}

.auth-help {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.auth-help a {
  color: var(--muted);
  font-size: 12px;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

.auth-switch a {
  color: #4EA8DE;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.membership-card {
  background: linear-gradient(135deg, rgba(107, 92, 246, 0.1), rgba(78, 168, 222, 0.1));
  border: 1px solid rgba(107, 92, 246, 0.3);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin-top: 20px;
}

.membership-card h3 {
  margin-bottom: 8px;
}

.membership-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.pending-site-notice {
  background: rgba(78, 168, 222, 0.1);
  border: 1px solid rgba(78, 168, 222, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.pending-site-notice p {
  margin: 0;
  color: #4EA8DE;
}

.pending-site-cta {
  background: linear-gradient(135deg, rgba(46, 196, 182, 0.15), rgba(78, 168, 222, 0.15));
  border: 2px solid rgba(46, 196, 182, 0.5);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.pending-site-cta p {
  margin: 0 0 12px 0;
  font-size: 15px;
}

.pending-site-cta .btn-primary {
  margin-right: 10px;
}

.pending-site-cta.pending-site-subscribed {
  background: rgba(107, 92, 246, 0.1);
  border-color: rgba(107, 92, 246, 0.4);
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
}

.btn-text:hover {
  color: var(--text);
  text-decoration: underline;
}

.subscribed-sites {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.subscribed-site-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.subscribed-site-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.site-card-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.site-card-place {
  font-size: 12px;
  color: var(--muted);
}

.site-card-subscribers {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.unsubscribe-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.unsubscribe-link:hover {
  color: var(--text);
}

.section-title {
  font-size: 14px;
  color: var(--muted);
  margin: 20px 0 12px;
  font-weight: 600;
}

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

.message-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

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

.message-author {
  font-weight: 600;
  font-size: 13px;
  color: #4EA8DE;
}

.message-site {
  font-size: 11px;
  color: var(--muted);
}

.message-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
}

.message-date {
  font-size: 11px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
}

.empty-state p {
  margin-bottom: 12px;
}

.subscribe-prompt {
  text-align: center;
  padding: 20px;
  background: rgba(78, 168, 222, 0.05);
  border: 1px solid rgba(78, 168, 222, 0.2);
  border-radius: 16px;
  margin-bottom: 20px;
}

.subscribe-prompt p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.message-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.message-form textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.message-form textarea:focus {
  outline: none;
  border-color: #4EA8DE;
}

.site-wall-place {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.site-wall-messages {
  margin-bottom: 24px;
}

.report-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.6;
}

.report-btn:hover {
  color: #EF476F;
  opacity: 1;
}

.unsubscribe-btn {
  margin-top: 16px;
  width: 100%;
}

/* =============================================
   UI VERSION LABEL
   ============================================= */

.ui-version-label {
  display: inline-block;
  font-size: 10px;
  color: #4EA8DE;
  background: rgba(78,168,222,0.15);
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* =============================================
   RESPONSIVE - MOBILE
   ============================================= */

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
    height: 100vh;
    height: 100dvh;
  }
  
  #map {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  /* Panel as visible bottom sheet on mobile - 3 snap points */
  #panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px 20px 0 0;
    z-index: 2000;
    /* Subtle layered shadow for premium elevated feel on mobile */
    box-shadow: 
      0 -1px 0 rgba(255,255,255,0.05),
      0 -4px 16px rgba(0,0,0,0.2),
      0 -12px 48px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: height;
  }
  
  /* Snap point: MIN (header only, ~72px) */
  #panel[data-sheet-state="min"] {
    height: 72px;
  }
  
  /* Snap point: MEDIUM (~45vh) */
  #panel[data-sheet-state="medium"] {
    height: 45vh;
  }
  
  /* Snap point: MAX (~90vh) */
  #panel[data-sheet-state="max"] {
    height: 90vh;
  }
  
  /* Sheet header - sticky tappable bar */
  .sheet-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px 4px;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
  }
  
  .sheet-header:active {
    cursor: grabbing;
  }
  
  /* Grab handle bar */
  .sheet-grab-handle {
    width: 48px;
    height: 5px;
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
    margin-bottom: 10px;
  }
  
  /* Toggle button - full width tappable */
  .sheet-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    padding: 12px 24px;
    min-height: 48px;
    width: 100%;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
  }
  
  .sheet-toggle-btn:hover,
  .sheet-toggle-btn:focus-visible {
    background: rgba(255,255,255,0.06);
    color: var(--text);
  }
  
  .sheet-toggle-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
  }
  
  .sheet-toggle-icon {
    font-size: 10px;
    transition: transform 0.25s ease;
  }
  
  /* Icon rotation based on state */
  #panel[data-sheet-state="max"] .sheet-toggle-icon {
    transform: rotate(180deg);
  }
  
  #panel[data-sheet-state="min"] .sheet-toggle-icon {
    transform: rotate(0deg);
  }
  
  #panel-main {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    padding-top: 0;
  }
  
  /* Hide content when minimized */
  #panel[data-sheet-state="min"] #panel-main {
    overflow: hidden;
  }
  
  .legend-desktop { display: none !important; }
  
  /* Hide floating controls on mobile - access via panel */
  .mobile-floating-controls {
    display: none !important;
  }
  
  .legend-toggle { 
    display: none !important;
  }
  
  .filter-toggle {
    display: none !important;
  }
  
  /* Show filter and legend buttons in panel on mobile */
  .filter-desktop-container {
    display: block;
  }
  
  .sidebar-legend-container {
    display: block;
  }
  
  /* Adjust logo size for mobile sheet */
  .logo {
    max-height: 48px;
  }
  
  /* Hide close button on mobile - panel is always visible */
  .mobile-sheet-close {
    display: none;
  }
  
  /* Hide backdrop on mobile - panel is always visible */
  .mobile-backdrop {
    display: none !important;
  }
  
  /* Compact spacing for mobile panel */
  #panel {
    padding: 0 16px 16px;
  }
  
  .search-container {
    margin-bottom: 8px;
  }
  
  .filter-desktop-container {
    margin-bottom: 6px;
  }
  
  .sidebar-legend-container {
    margin-bottom: 6px;
  }
  
  .sidebar-hint {
    margin-top: 6px;
    margin-bottom: 4px;
  }
  
  hr {
    margin: 8px 0;
  }
  
  .site-card {
    padding: 14px 16px 16px;
    margin-top: 4px;
  }
}

/* Hide mobile-only elements on desktop */
@media (min-width: 901px) {
  .sheet-header {
    display: none;
  }
  
  .mobile-sheet-close {
    display: none;
  }
  
  .mobile-floating-controls {
    display: none;
  }
  
  .mobile-backdrop {
    display: none !important;
  }
  
  .mobile-expand-btn {
    display: none;
  }
}

/* =============================================
   SIDEBAR FOOTER & ABOUT LINK
   ============================================= */

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.about-link {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.about-link:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}

/* =============================================
   FIRST-VISIT NOTICE BANNER
   ============================================= */

.notice-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: rgba(15, 18, 23, 0.97);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
}

.notice-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px;
}

.notice-text {
  margin-bottom: 16px;
}

.notice-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 12px;
}

.notice-body-fr,
.notice-body-en {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 8px;
}

.notice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notice-btn {
  font-family: inherit;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.notice-btn-primary {
  background: #1D4E5C;
  border: none;
  color: #d0e8ef;
}

.notice-btn-primary:hover {
  background: #265D6C;
}

.notice-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}

.notice-btn-secondary:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}

/* =============================================
   ABOUT MODAL
   ============================================= */

.about-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.about-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.about-close:hover {
  color: var(--text);
}

.about-lang-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.lang-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}

.lang-btn.active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
}

.about-content h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--text);
}

.about-content h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 20px 0 10px;
  color: var(--text);
}

.about-content p {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 12px;
}

/* =============================================
   RESOURCES MODAL
   ============================================= */

.resources-panel {
  max-width: 640px;
}

.resources-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.resources-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.resources-content h4 {
  font-size: 13px;
  font-weight: 500;
  margin: 18px 0 10px;
  color: var(--text);
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.resources-subtitle {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 20px !important;
}

.resources-disclaimer,
.resources-note {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

.resources-link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.resources-link-list li {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.resources-link-list li:last-child {
  border-bottom: none;
}

.resources-link-list a,
.resources-link-list a:link,
.resources-link-list a:visited {
  color: #60a5fa;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  transition: color 0.15s ease;
}

.resources-link-list a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.resources-link-list a:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 2px;
}

.resources-link-list a::before {
  content: "↗";
  opacity: 0.5;
  font-size: 11px;
  flex-shrink: 0;
}
