:root {
  --navy: #0b1b2b;
  --sea: #0b6b6f;
  --aqua: #24b6b0;
  --sand: #f4efe8;
  --cloud: #f6f9fb;
  --ink: #1b2a35;
  --muted: #5d6b76;
  --accent: #ff8a3d;
  --border: rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cloud);
}

a {
  color: inherit;
  text-decoration: none;
}

.nav {
  position: fixed;
  top: 0;
  height: 56px;
  width: 100%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10vw;
  border-bottom: 1px solid #cdcdcd;
  z-index: 20000;
}

.nav-logo {
  height: 52px;
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 52px;
}

.nav-links {
  display: flex;
  gap: 0;
  font-weight: 500;
  color: #000;
}

.nav-links a {
  padding: 14px 16px;
}

.lang-switch {
  display: flex;
  gap: 6px;
  background: rgba(11, 27, 43, 0.08);
  padding: 4px;
  border-radius: 999px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.lang-btn.active {
  background: white;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

main {
  padding-top: 0;
}

.map-shell {
  position: relative;
  height: 100vh;
  width: 100%;
  background: #dfe7ef;
}

#map,
#windy {
  position: absolute;
  inset: 0;
}

#windy {
  display: none;
}

.overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(320px, 90vw);
  z-index: 500;
}

.mapshare-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.mapshare-card.is-hidden {
  display: none;
}

.mapshare-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--navy);
}

.mapshare-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.mapshare-row input {
  flex: 1;
  height: 44px;
  max-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
}

.mapshare-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mapshare-helper {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 12px;
  color: var(--muted);
}

.mapshare-helper summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  list-style: none;
}

.mapshare-helper summary::-webkit-details-marker {
  display: none;
}

.mapshare-helper summary::after {
  content: "›";
  display: inline-block;
  margin-left: 6px;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.mapshare-helper[open] summary::after {
  transform: rotate(-90deg);
}

.mapshare-helper ol {
  margin: 10px 0 0 18px;
  display: grid;
  gap: 6px;
}

.mapshare-error {
  margin-top: 6px;
  color: #c2410c;
  font-weight: 600;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  height: 44px;
  max-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-outline {
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: white;
  color: var(--ink);
}

.btn-ghost {
  background: rgba(11, 27, 43, 0.08);
  color: var(--ink);
}

.upgrade-hint {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--muted);
  font-size: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.upgrade-hint a {
  color: var(--navy);
  font-weight: 600;
}

.upgrade-hint.visible {
  display: inline-flex;
}

#info-btn {
  position: absolute;
  right: 18px;
  bottom: 66px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(11, 27, 43, 0.85);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1001;
  display: none;
}

#legend-container {
  position: absolute;
  right: 18px;
  bottom: 118px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 1001;
  display: none;
}

.message-btn {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(11, 27, 43, 0.9);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
  z-index: 1001;
}

.message-btn.visible {
  display: inline-flex;
}

.message-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 43, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2002;
  padding: 20px;
}

.message-modal.active {
  display: flex;
}

.message-card {
  position: relative;
  width: min(360px, 92vw);
  background: white;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-card h3 {
  margin: 0;
  font-size: 16px;
  color: var(--navy);
}

.message-card form {
  display: grid;
  gap: 10px;
}

.message-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}

.message-card input,
.message-card textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}

.message-card textarea {
  resize: vertical;
}

.info-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: -4px;
}

.char-counter {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.message-feedback {
  min-height: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sea);
}

.message-card button[type="submit"] {
  width: 100%;
}

.message-feedback.error {
  color: #c2410c;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.legend-color {
  width: 14px;
  height: 6px;
  border-radius: 999px;
}

/* Windy UI layers need to sit above our overlay */
#bottom,
#logo-wrapper,
#mobile-ovr-select,
#embed-zoom,
#windy .leaflet-control-container {
  z-index: 1000 !important;
}

.loading-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-mask.active {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .overlay {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .mapshare-row {
    flex-direction: column;
  }
  .mapshare-row input,
  .mapshare-row .btn {
    width: 100%;
  }

  .message-btn {
    left: 12px;
    top: 12px;
  }
}
