:root {
  --bg: #070b14;
  --panel: rgba(12, 18, 32, .78);
  --solid: #0c1220;
  --ink: #e6f1ff;
  --muted: #8396b5;
  --line: rgba(120, 160, 255, .2);
  --accent: #3df5ff;
  --accent-ink: #041016;
  --violet: #8b5cff;
  --gold: #ffd84d;
  --warn: #ff9a6b;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  padding: env(safe-area-inset-top) 0 0;
}
a { color: var(--accent); }

/* ---- map ---- */
#map { position: absolute; inset: 0; z-index: 0; background: #0b1220; }
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.9) saturate(.65); }
.leaflet-control-layers {
  background: var(--solid); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 0 18px rgba(61, 245, 255, .15);
}
.leaflet-control-layers-toggle { background-color: #fff; border-radius: 10px; filter: invert(1) hue-rotate(180deg) brightness(.9); }
.leaflet-control-layers-expanded { padding: 8px 12px; font-size: 13px; }
.leaflet-control-layers label { margin: 3px 0; }
.leaflet-control-attribution { background: rgba(7, 11, 20, .75) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-bar a { background: var(--solid); color: var(--ink); border-color: var(--line); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: rgba(12, 18, 32, .94); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 0 22px rgba(61, 245, 255, .22);
}
.leaflet-popup-content { font-family: inherit; line-height: 1.45; }
.leaflet-popup-content b { display: block; margin-bottom: 4px; color: var(--accent); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.actions { margin-top: 10px; display: flex; gap: 8px; }
.actions button { padding: 4px 10px; font-size: 12.5px; }

.pin-wrap { background: none; border: 0; }
.pin {
  display: block; width: 14px; height: 14px; margin: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 245, 255, .25), 0 0 14px 4px rgba(61, 245, 255, .7);
  animation: pulse 2.4s ease-out infinite;
}
.pin.star { background: var(--gold); --glow: 255, 216, 77; box-shadow: 0 0 0 3px rgba(255, 216, 77, .25), 0 0 14px 4px rgba(255, 216, 77, .75); }
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ---- panel ---- */
#panel {
  position: absolute; top: 12px; left: 12px; bottom: 12px;
  width: 360px; max-width: calc(100vw - 24px); z-index: 1000;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(61, 245, 255, .06), 0 10px 40px rgba(0, 0, 0, .55), 0 0 32px rgba(139, 92, 255, .15);
  animation: slide-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
#panel.collapsed { bottom: auto; }
#panel.collapsed #body { display: none; }

header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
header h1 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; margin: 0; flex: 1; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.logo { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 3px var(--accent); animation: pulse 2.4s ease-in-out infinite; }

button, .btn {
  font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; text-align: center; display: inline-block;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--ink);
  padding: 7px 11px; transition: border-color .2s, box-shadow .2s, background .2s;
}
button:hover, .btn:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(61, 245, 255, .25); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: linear-gradient(135deg, var(--accent), #6fb3ff); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.primary:hover { box-shadow: 0 0 18px rgba(61, 245, 255, .55); }
button:disabled { opacity: .5; cursor: default; box-shadow: none; }
[hidden] { display: none !important; }

#body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#controls { padding: 12px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); max-height: 62%; overflow-y: auto; }
#signed-in-actions, .row { display: flex; flex-wrap: wrap; gap: 8px; }
.row.end { justify-content: flex-end; margin-top: 14px; }
input[type=search], input[readonly], select {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--ink);
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px;
}
#filters { display: flex; gap: 6px; }
#filters button { flex: 1; padding: 5px 6px; font-size: 12px; border-radius: 999px; }
#filters button[aria-pressed=true] { background: rgba(61, 245, 255, .15); border-color: var(--accent); color: var(--accent); }
#status, #saved-status, .small { font-size: 12.5px; color: var(--muted); }
#status { min-height: 1.3em; }
#status.error, .small.error { color: var(--warn); }
#saved-box { display: grid; gap: 8px; font-size: 13px; padding: 10px 0 2px; border-top: 1px solid var(--line); }
#progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; display: none; }
#progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--accent)); transition: width .2s; }

#list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#list li { padding: 11px 14px; border-bottom: 1px solid var(--line); position: relative; animation: fade-up .35s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#list li.has-pin { cursor: pointer; }
#list li.has-pin:hover { background: rgba(61, 245, 255, .07); }
.name { font-weight: 600; font-size: 14px; padding-right: 30px; }
.meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tag { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.tag.ok { color: var(--accent); }
.tag.fail { color: var(--warn); }
.empty { padding: 20px 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.star-btn { position: absolute; top: 8px; right: 10px; padding: 2px 7px; border: 0; background: none; font-size: 18px; color: var(--muted); }
.star-btn.on { color: var(--gold); text-shadow: 0 0 10px rgba(255, 216, 77, .7); }

/* ---- dialogs ---- */
dialog.modal {
  max-width: 480px; width: calc(100vw - 32px); max-height: 90vh; overflow-y: auto;
  background: var(--solid); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  box-shadow: 0 0 40px rgba(61, 245, 255, .15), 0 20px 60px rgba(0, 0, 0, .6);
}
dialog.modal[open] { animation: fade-up .25s ease both; }
dialog.modal::backdrop { background: rgba(2, 5, 12, .7); backdrop-filter: blur(3px); }
dialog.modal h2 { margin: 0 0 10px; font-size: 18px; }
dialog.modal p, dialog.modal li { font-size: 14px; line-height: 1.5; }
.field { display: grid; gap: 6px; font-size: 13px; margin: 12px 0; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-top: 12px; }
#consent-msg { font-size: 13px; margin-top: 8px; color: var(--muted); min-height: 1.2em; }
#consent-msg.error { color: var(--warn); }
#share-result { margin-top: 14px; display: grid; gap: 10px; }
details { margin-top: 14px; font-size: 13px; }
summary { cursor: pointer; color: var(--accent); }
#share-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
#share-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
#share-list button { padding: 3px 8px; font-size: 12px; }

/* ---- plain pages (privacy / expired) ---- */
body.doc { height: auto; overflow: auto; }
body.doc main { max-width: 680px; margin: 0 auto; padding: 24px 18px 60px; line-height: 1.6; }
body.doc h2 { font-size: 18px; margin-top: 28px; }

/* ---- mobile ---- */
@media (max-width: 600px) {
  #panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; height: 52vh;
           border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); animation-name: rise; }
  #panel.collapsed { height: auto; }
  .leaflet-bottom { bottom: 52vh; }
}
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.logo-img { width: 26px; height: 26px; object-fit: contain; }

/* =========================================
   NEARLY — LANDING PAGE
========================================= */

.landing {
  min-height: 100vh;
  overflow: hidden;
  background: #070b14;
  color: #edf4ff;
}

.landing-nav {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 88px;
  padding: 0 8%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: .2em;
}

.brand img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.nav-login {
  color: #dce9f8;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.14);
  padding: 10px 18px;
  border-radius: 30px;
  transition: .2s;
}

.nav-login:hover {
  border-color: #3df5ff;
  color: #3df5ff;
}

.nav-login span {
  margin-left: 8px;
}

/* HERO */

.hero {
  position: relative;
  min-height: 760px;
  height: 100svh;
  max-height: 950px;
  padding: 170px 10% 100px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 75% 45%, rgba(22, 88, 125, .18), transparent 38%),
    radial-gradient(ellipse at 20% 90%, rgba(47, 60, 133, .12), transparent 40%),
    #070b14;
}

.hero-watermark {
  position: absolute;
  width: min(650px, 65vw);
  height: min(650px, 65vw);
  right: 5%;
  top: 48%;
  transform: translateY(-50%);
  background-image: url("/static/logo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: .085;
  filter: drop-shadow(0 0 55px rgba(61,245,255,.4));
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #070b14 5%,
    rgba(7,11,20,.95) 38%,
    rgba(7,11,20,.2) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 690px;
}

.eyebrow,
.section-label {
  color: #53dce9;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .22em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 27px;
  padding: 9px 13px;
  border: 1px solid rgba(61,245,255,.19);
  border-radius: 30px;
  background: rgba(61,245,255,.045);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3df5ff;
  box-shadow: 0 0 12px #3df5ff;
}

.hero h1 {
  font-size: clamp(48px, 7vw, 86px);
  line-height: 1.06;
  letter-spacing: -.065em;
  font-weight: 750;
  margin: 0;
}

.hero h1 span {
  color: #52dce9;
}

.hero-description {
  max-width: 510px;
  margin: 25px 0 30px;
  color: #99a9bf;
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}

.hero-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 0 23px;
  border-radius: 9px;
  background: #e9faff;
  color: #07131e;
  text-decoration: none;
  font-weight: 750;
  font-size: 14px;
  box-shadow: 0 0 28px rgba(61,245,255,.12);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.hero-button:hover {
  transform: translateY(-3px);
  background: #3df5ff;
  box-shadow: 0 0 35px rgba(61,245,255,.28);
}

.hero-button svg {
  width: 19px;
  height: 19px;
}

.button-arrow {
  font-size: 18px;
  margin-left: 5px;
}

.hero-note {
  color: #74859d;
  font-size: 11px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 35px;
  color: #a3b2c7;
  font-size: 12px;
}

.hero-trust i {
  color: #3df5ff;
  font-style: normal;
  margin-right: 5px;
}

.hero-bottom {
  position: absolute;
  z-index: 2;
  bottom: 27px;
  left: 10%;
  right: 10%;
  display: flex;
  justify-content: space-between;
  color: #52627a;
  font-size: 9px;
  letter-spacing: .16em;
}

/* FEATURES */

.features {
  position: relative;
  padding: 110px 10% 120px;
  background: #0a101d;
  border-top: 1px solid rgba(255,255,255,.06);
}

.section-heading {
  text-align: center;
  margin-bottom: 55px;
}

.section-heading h2,
.final-cta h2 {
  font-size: clamp(30px, 4vw, 45px);
  letter-spacing: -.045em;
  margin: 17px 0 10px;
}

.section-heading p {
  color: #8495ad;
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
  max-width: 1120px;
  margin: auto;
}

.feature-card {
  min-height: 260px;
  padding: 28px;
  border: 1px solid rgba(135,170,210,.13);
  border-radius: 13px;
  background: linear-gradient(
    145deg,
    rgba(255,255,255,.035),
    rgba(255,255,255,.008)
  );
  transition: .25s;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(61,245,255,.35);
  background: rgba(61,245,255,.035);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #3df5ff;
  background: rgba(61,245,255,.09);
  font-size: 25px;
  margin-bottom: 27px;
}

.feature-number {
  color: #60758f;
  font-size: 9px;
  letter-spacing: .15em;
}

.feature-card h3 {
  font-size: 19px;
  letter-spacing: -.025em;
  margin: 12px 0;
}

.feature-card p {
  color: #8495ad;
  font-size: 13px;
  line-height: 1.8;
}

/* FINAL CTA */

.final-cta {
  position: relative;
  overflow: hidden;
  padding: 100px 20px;
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(23,94,120,.18), transparent 65%),
    #070b14;
}

.final-cta h2 {
  margin-bottom: 30px;
}

.cta-watermark {
  position: absolute;
  inset: 0;
  background-image: url("/static/logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 300px;
  opacity: .035;
  pointer-events: none;
}

.final-cta > *:not(.cta-watermark) {
  position: relative;
  z-index: 1;
}

/* FOOTER */

.landing-footer {
  min-height: 75px;
  padding: 20px 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: #687991;
  font-size: 11px;
}

.landing-footer a {
  color: #a7b7ca;
  text-decoration: none;
}

.footer-brand {
  font-weight: 800;
  letter-spacing: .18em;
}

/* MOBILE */

@media (max-width: 700px) {
  .landing-nav {
    height: 72px;
    padding: 0 22px;
  }

  .hero {
    min-height: 720px;
    height: auto;
    padding: 155px 25px 110px;
  }

  .hero-watermark {
    width: 95vw;
    height: 95vw;
    right: -22%;
    top: 53%;
    opacity: .07;
  }

  .hero::after {
    background: linear-gradient(
      90deg,
      rgba(7,11,20,.95),
      rgba(7,11,20,.72)
    );
  }

  .hero h1 {
    font-size: clamp(46px, 12vw, 68px);
  }

  .hero-description {
    font-size: 14px;
  }

  .hero-trust {
    flex-direction: column;
    gap: 10px;
  }

  .hero-bottom {
    left: 25px;
    right: 25px;
    font-size: 8px;
  }

  .features {
    padding: 80px 22px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }

  .final-cta {
    padding: 80px 22px;
  }

  .landing-footer {
    padding: 25px;
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing *,
  .landing *::before,
  .landing *::after {
    animation: none !important;
    transition: none !important;
  }
}
