*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  background: #0b1021;
  color: #e5ecff;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

p {
  margin: 0;
}

:root {
  color-scheme: dark;
  --panel: rgba(13, 18, 35, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --primary: #7bd8ff;
  --primary-strong: #4ad0e9;
  --accent: #e1a2ff;
  --text: #e5ecff;
  --muted: #9ab3d8;
  --footer-height: 54px;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk/V8mDoQDjQSkFtoMM3T6r8E7mPbF4Cw.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk/V8mDoQDjQSkFtoMM3T6r8E7mPb94C-s0.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2") format("woff2");
}

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -2;
}

.orb {
  position: absolute;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  filter: blur(200px);
  opacity: 0.8;
}

.orb-left {
  background: radial-gradient(circle, #4ad0e9, transparent 55%);
  top: -260px;
  left: -220px;
}

.orb-right {
  background: radial-gradient(circle, #e1a2ff, transparent 55%);
  bottom: -260px;
  right: -220px;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
  z-index: -1;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(32px, 4vw, 64px) clamp(22px, 7vw, 64px) 0;
  position: relative;
  max-width: min(1600px, 96vw);
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 6px;
}

.lede {
  color: var(--muted);
  margin-top: 8px;
  max-width: 560px;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
  color: var(--text);
}

button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: rgba(255, 255, 255, 0.14);
  color: #041022;
  font-weight: 600;
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
}

.small {
  padding: 8px 10px;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  width: 100%;
}

.stats-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: min(640px, 100%);
}

.stats-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stats-toggle .toggle {
  color: var(--muted);
}

.hero-text {
  flex: 1;
  min-width: 220px;
}

.hero-actions {
  width: 100%;
}

.top-bar {
  position: static;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 48px);
}

.user-chip {
  position: static;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--muted);
}

.sync-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 8px rgba(154, 179, 216, 0.4);
}

.sync-chip[data-state="syncing"]::before {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(123, 216, 255, 0.6);
}

.sync-chip[data-state="pending"]::before {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(225, 162, 255, 0.6);
}

.sync-chip[data-state="offline"]::before {
  background: #f4b26a;
  box-shadow: 0 0 8px rgba(244, 178, 106, 0.5);
}

.sync-chip[data-state="error"]::before {
  background: #ffb4b4;
  box-shadow: 0 0 8px rgba(255, 180, 180, 0.6);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form.hidden {
  display: none !important;
}

.auth-form input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  color: var(--text);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-error {
  margin: 0 0 8px;
  color: #ffb4b4;
  font-size: 14px;
}

.auth-tabs .tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

.auth-tabs .tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #041022;
  border-color: rgba(255, 255, 255, 0.25);
}

.auth-form button {
  width: 100%;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.auth-link {
  color: var(--primary);
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  color: var(--primary-strong);
  text-decoration: underline;
  outline: none;
}

.stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 14px;
  text-align: center;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  min-height: 2.2em;
}

.stat p {
  color: var(--muted);
  margin-top: 0;
}

.layout {
  padding: 20px clamp(22px, 7vw, 64px) 48px;
  max-width: min(1600px, 96vw);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  overflow-x: hidden;
}

.layout > * {
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.map-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: auto;
}

.map-panel #map {
  flex: 0 0 auto;
  height: 460px;
  min-height: 420px;
  border-radius: 12px;
  overflow: hidden;
}

.maptiler-logo img {
  display: block;
  height: 18px;
  width: auto;
}

@media (max-width: 640px) {
  .maptiler-logo {
    bottom: 44px !important;
  }
}

/* Keep Leaflet zoom buttons clear of the floating controls on larger screens */
@media (min-width: 721px) {
  .leaflet-top.leaflet-left {
    margin-top: 100px;
    margin-left: 8px;
    z-index: 400;
  }
}

.map-actions.floating {
  display: inline-flex;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: calc(100% - 24px);
  max-width: min(700px, 100%);
  align-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(10, 16, 32, 0.75);
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 500;
}

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

.panel-header h2 {
  margin-top: 4px;
}

.eyebrow {
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.map-actions,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.map-actions.hidden {
  display: none !important;
}

.map-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 0;
}

.map-search input {
  min-width: 0;
  width: 100%;
}

.map-actions > * {
  min-width: 0;
}

.map-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.toggle.switch {
  position: relative;
  gap: 10px;
}

.toggle.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.toggle.switch .switch-control {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle.switch .switch-control::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle.switch input:checked + .switch-control {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: rgba(255, 255, 255, 0.2);
}

.toggle.switch input:checked + .switch-control::after {
  transform: translate(20px, -50%);
  background: #041022;
}

.toggle.switch input:focus-visible + .switch-control {
  outline: 2px solid rgba(123, 216, 255, 0.5);
  outline-offset: 2px;
}

.toggle.switch input:disabled + .switch-control {
  opacity: 0.5;
  cursor: not-allowed;
}

#form-panel form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.has-suggestions {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(13, 18, 32, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestions[hidden] {
  display: none !important;
  visibility: hidden;
}

.suggestions button {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.suggestions button:hover,
.suggestions button:focus-visible {
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
}

.field label {
  font-size: 14px;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea,
input[list] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  color: var(--text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  resize: vertical;
  max-height: 260px;
}

textarea {
  min-height: 64px;
}

#notes,
#edit-description-input {
  min-height: 88px;
}

#edit-description-input {
  max-height: min(50vh, 420px);
}

input[type="file"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  color: var(--text);
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  margin-right: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

input[type="file"]::file-selector-button:active,
input[type="file"]::-webkit-file-upload-button:active {
  transform: translateY(0);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(123, 216, 255, 0.2);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.stars {
  display: inline-flex;
  gap: 6px;
}

.stars button {
  font-size: 22px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.08);
}

.stars button.active {
  background: var(--primary);
  color: #0b1021;
}

.stars-field {
  border: 0;
  padding: 0;
  margin: 0;
}

.stars-field legend {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 0;
}

input[type="range"] {
  width: 100%;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.field-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 12px;
}

.field-top label {
  flex-shrink: 0;
  margin-bottom: 4px;
}

@media (max-width: 1100px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding-top: 60px;
  }

  .stats {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .stats-block {
    width: 100%;
  }

  .hero-actions {
    order: 3;
  }
}

@media (max-width: 900px) {
  .field.split {
    grid-template-columns: 1fr;
  }

  .field.split .stars {
    justify-content: flex-start;
    width: auto;
  }
}

.field-top .range-labels span {
  flex: 1;
  text-align: center;
  min-width: 48px;
}

.field-top .range-labels span:first-child {
  text-align: left;
}

.field-top .range-labels span:nth-child(2) {
  text-align: center;
}

.field-top .range-labels span:last-child {
  text-align: right;
}

.wave-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.size-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.size-legend span {
  flex: 1;
  text-align: center;
}

.size-legend span:first-child {
  text-align: left;
}

.size-legend span:last-child {
  text-align: right;
}

.size-quip {
  margin: 8px 0 10px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

.list-panel .filters input,
.list-panel .filters select {
  min-width: 140px;
}

.spot-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.spot-list-spacer {
  width: 100%;
  grid-column: 1 / -1;
  pointer-events: none;
}

.spot-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.spot-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.spot-card-header .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.notes {
  color: #d7e3ff;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.spot-description {
  color: #d7e3ff;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.5em * 3);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.description-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 6px;
}

.spot-read-more {
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.spot-read-more:hover,
.spot-read-more:focus-visible {
  color: var(--text);
  outline: none;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions button,
.spot-read-more {
  touch-action: manipulation;
}

.session-delete-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  text-underline-offset: 2px;
}

.session-delete-link:hover,
.session-delete-link:focus-visible {
  color: var(--text);
  opacity: 1;
  outline: none;
  border-color: transparent;
  background: transparent;
  transform: none;
}

.session-media {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.session-photo-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.session-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  width: min(680px, 90vw);
  padding: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

dialog::backdrop {
  background: rgba(4, 7, 16, 0.6);
  backdrop-filter: blur(6px);
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 16, 0.6);
  backdrop-filter: blur(6px);
  z-index: 700;
}

#auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 800;
}

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

.modal-body {
  display: grid;
  gap: 10px;
  max-height: 60vh;
  overflow: auto;
}

#edit-description-input[readonly] {
  cursor: default;
  opacity: 0.9;
}

.modal-session {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.session-load-more {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.photo-modal {
  max-height: 90vh;
  overflow: hidden;
}

.photo-modal .modal-body {
  max-height: none;
  overflow: hidden;
}

.photo-modal img {
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 160px);
  width: 100%;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.photo-modal-body {
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 19, 36, 0.9);
  border: 1px solid var(--primary);
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 2000;
}

.update-prompt {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(12, 19, 36, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  z-index: 1900;
}

.update-actions {
  display: flex;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -4px);
}

.site-footer {
  position: static;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px;
  margin-top: 24px;
  background: rgba(8, 12, 24, 0.75);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 13px;
  z-index: 1;
}

.auth-open .top-bar,
.auth-open .hero,
.auth-open .site-footer {
  display: none;
}

.auth-open #update-prompt {
  display: none;
}

.auth-open #sync-chip {
  display: none;
}

.auth-open .layout > :not(#auth-modal):not(#auth-backdrop) {
  display: none;
}

.auth-open .toast {
  bottom: 16px;
}

.footer-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--primary-strong);
  outline: none;
}

.legal-header {
  max-width: min(1000px, 96vw);
  margin: 32px auto 0;
  padding: 0 clamp(22px, 7vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: 100%;
}

.legal-title {
  justify-self: center;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.legal-lang {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-lang-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.legal-lang-link:hover,
.legal-lang-link:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  outline: none;
}

.legal-lang-link.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

.legal-layout {
  max-width: min(1000px, 96vw);
  justify-items: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.legal-panel {
  padding: 20px;
  width: min(100%, 860px);
}

.privacy-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.privacy-section h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  color: var(--text);
}

.privacy-section p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.privacy-section p + p {
  margin-top: 8px;
}

.privacy-section a {
  color: var(--primary);
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.privacy-section ul {
  margin: 6px 0 0 18px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.privacy-section li + li {
  margin-top: 6px;
}

.privacy-section .muted {
  color: var(--text);
}

.leaflet-container {
  background: #0b1021;
}

.leaflet-popup-content,
.leaflet-popup-content .popup {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.leaflet-control-container .leaflet-top.leaflet-right {
  top: 60px;
}

.leaflet-marker-icon.spot-icon,
.leaflet-marker-icon.search-icon {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: linear-gradient(135deg, rgba(15, 27, 51, 0.9), rgba(36, 56, 90, 0.9));
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.marker-cluster,
.marker-cluster div {
  box-sizing: border-box;
}

.marker-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.marker-cluster div {
  background: rgba(10, 16, 32, 0.85);
  color: #e5ecff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.marker-cluster span {
  line-height: 1;
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-areas:
      "map form"
      "list form";
  }

.map-panel {
  grid-area: map;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  height: 100%;
}

  .map-wrapper {
    flex: 1 1 auto;
    height: 100%;
  }

  .map-panel #map {
    flex: 1 1 auto;
    height: 100%;
    min-height: 420px;
  }

  .form-panel {
    grid-area: form;
    position: sticky;
    top: 0;
    align-self: flex-start;
    /* max-height: calc(200vh - 0px); */
    overflow: auto;
  }

.list-panel {
  grid-area: list;
}

.list-panel .panel-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.list-panel .filters {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.list-panel .filters > * {
  flex: 1 1 180px;
  min-width: 0;
}
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    padding-top: 24px;
  }

  .stats {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .layout {
    padding-left: 22px;
    padding-right: 22px;
  }

  .panel {
    padding: 14px;
  }

  .map-panel #map {
    height: 420px;
    min-height: 360px;
  }

  .map-actions.floating {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    align-content: flex-start;
  }

  .map-actions {
    gap: 8px;
  }

  .map-actions .small,
  .map-actions button,
  .map-actions input,
  .map-actions label {
    font-size: 13px;
  }

  .map-search {
    flex: 1 1 160px;
    min-width: 0;
  }

  .map-search input {
    height: 38px;
    padding: 10px;
  }

  .map-actions button {
    padding: 8px 10px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
    text-align: center;
  }

  .list-panel .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-panel .filters {
    width: 100%;
    flex-direction: column;
  }

  .list-panel .filters > * {
    width: 100%;
    min-width: 0;
  }

  /* Hide leaflet zoom buttons on touch-first small screens */
  .leaflet-control-zoom {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .leaflet-popup-content {
    max-width: 240px;
    font-size: 13px;
    line-height: 1.3;
  }

  .leaflet-popup-content-wrapper {
    max-width: 260px;
  }

  .layout {
    padding-left: 26px;
    padding-right: 26px;
  }

  .panel {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  .map-actions.floating {
    width: calc(100% - 32px);
    max-width: min(700px, 100%);
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    flex-wrap: wrap;
  }

  .list-panel .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (min-width: 1100px) {
  .map-actions {
    flex-wrap: nowrap;
  }
}
