/* Leonida Interactive Map.
   Palette and type are modelled on rockstargames.com/VI: deep navy surfaces, a peach-to-pink
   sunset, lilac and butter-yellow accents, condensed uppercase headings over a geometric sans.
   The fonts are open stand-ins (Barlow Condensed, Jost) for Rockstar's proprietary faces. */

:root {
  --navy-950: #070810;
  --navy-900: #0c0d1b;
  --navy-850: #111222;
  --navy-800: #18182d;
  --navy-700: #1f1f38;
  --navy-600: #252644;
  --navy-500: #38365d;
  --plum: #4b2f54;
  --plum-deep: #31223e;

  --pink: #ffb2c6;
  --pink-hot: #e9639b;
  --peach: #ffd4a8;
  --peach-deep: #fec497;
  --purple: #9f71b6;
  --lilac: #ccc2f5;
  --lilac-pale: #e5ddff;
  --butter: #fff9cb;
  --lime: #e6ffa3;
  --mint: #b8f0ea;
  --sky: #cae9f7;
  --blush: #fee8ea;

  --sea: #2c68a6;

  --text: #ffffff;
  --text-soft: rgba(229, 221, 255, 0.72);
  --text-faint: rgba(229, 221, 255, 0.46);
  --line: rgba(204, 194, 245, 0.14);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.12);

  --sunset: linear-gradient(100deg, #fec497 0%, #f08fa6 48%, #e9639b 72%, #9f71b6 100%);
  --sunset-soft: linear-gradient(180deg, #ccc2f5 0%, #f3b3c6 55%, #ffd4a8 100%);

  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Jost", "Century Gothic", "Avenir Next", system-ui, sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  --gap: 12px;
  --sidebar-w: 372px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow: 0 18px 50px rgba(7, 8, 16, 0.55);
}

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

html, body {
  height: 100%;
  margin: 0;
  background: var(--navy-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--pink); text-underline-offset: 2px; }
a:hover { color: var(--butter); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--butter); outline-offset: 2px; }

.ic { display: block; flex: none; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lilac);
}

kbd {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--glass-strong);
  color: var(--lilac-pale);
}

/* ---------- layout ---------- */

.app { position: fixed; inset: 0; }

.map {
  position: absolute;
  inset: 0;
  background: var(--sea);
  font-family: var(--font-body);
  outline: none;
}
/* A navy vignette so the floating panels sit on the map instead of fighting it. */
.app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  background:
    linear-gradient(90deg, rgba(12, 13, 27, 0.5) 0, rgba(12, 13, 27, 0) 34%),
    linear-gradient(0deg, rgba(12, 13, 27, 0.45) 0, rgba(12, 13, 27, 0) 16%),
    linear-gradient(180deg, rgba(12, 13, 27, 0.3) 0, rgba(12, 13, 27, 0) 14%);
}
.map.is-placing, .map.is-placing .leaflet-interactive { cursor: crosshair !important; }

/* ---------- sidebar ---------- */

.sidebar {
  position: absolute;
  z-index: 1000;
  top: var(--gap);
  left: var(--gap);
  bottom: var(--gap);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: linear-gradient(189deg, rgba(31, 31, 56, 0.96) 0%, rgba(24, 24, 45, 0.97) 30%, rgba(17, 18, 34, 0.98) 65%, rgba(12, 13, 27, 0.98) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  /* No backdrop blur here: the panel is 96% opaque, so a blur would not show, but the browser
     would still redo it over the whole panel for every frame the map moves underneath. */
  overflow: hidden;
  transition: transform 0.5s var(--ease), opacity 0.3s ease;
}
/* Until the script has put the sidebar where it belongs, nothing slides into place. */
.app.is-booting .sidebar, .app.is-booting .statusbar { transition: none; }
.app.is-sidebar-closed .sidebar {
  transform: translateX(calc(-100% - 2 * var(--gap)));
  opacity: 0;
  pointer-events: none;
}

.brand {
  position: relative;
  flex: none;
  height: 132px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-end;
  color: var(--navy-900);
  background: var(--sunset-soft);
  overflow: hidden;
  isolation: isolate;
}
/* The striped retro sun. */
.brand__sun {
  position: absolute;
  z-index: -2;
  right: 34px;
  bottom: -64px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff9cb 0%, #fec497 38%, #e9639b 78%);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 13px, transparent 13px 17px);
  mask: repeating-linear-gradient(180deg, #000 0 13px, transparent 13px 17px);
  opacity: 0.95;
}
.brand__palm {
  position: absolute;
  z-index: -1;
  color: var(--plum);
  opacity: 0.82;
}
.brand__palm svg { stroke-width: 1.1; }
.brand__palm--a { right: -22px; bottom: -26px; transform: rotate(6deg); }
.brand__palm--b { right: 96px; bottom: -20px; transform: scaleX(-1) rotate(8deg); opacity: 0.45; }

.brand__text { position: relative; }
.brand__eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--plum);
}
.brand__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 58px;
  line-height: 0.86;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--navy-900);
}
.brand__mark {
  position: absolute;
  top: 16px;
  left: 20px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 5px 10px 4px;
  color: transparent;
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
}
/* The numeral is gradient-filled text, so its navy plate is painted behind it. */
.brand__mark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 8px;
  background: var(--navy-900);
}
.brand__close { position: absolute; top: 12px; right: 12px; }

.sidebar__tools {
  flex: none;
  padding: 14px 16px 12px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 1000px;
  background: var(--glass);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}
.search:focus-within { border-color: var(--pink); background: var(--glass-strong); }
.search__icon { color: var(--lilac); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: 0;
  font-size: 15px;
}
.search input::placeholder { color: var(--text-faint); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); cursor: pointer; }
.search:focus-within .search__kbd { display: none; }

.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-row--wrap { display: flex; flex-wrap: wrap; }

.pill {
  height: 40px;
  padding: 0 18px;
  border-radius: 1000px;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s, box-shadow 0.2s;
}
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: translateY(0) scale(0.98); }
.pill--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.pill--pink { background: var(--pink); color: var(--navy-900); }
.pill--pink:hover { background: var(--butter); }
.pill--plum { background: var(--plum); color: var(--blush); }
.pill--plum:hover { background: #5d3a68; }
.pill--ghost { background: var(--glass); color: var(--lilac-pale); box-shadow: inset 0 0 0 1px var(--line); }
.pill--ghost:hover { background: var(--glass-strong); color: #fff; }
.pill[aria-pressed="true"] { background: var(--butter); color: var(--navy-900); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 17, 23, 0.55);
  color: #fff;
  backdrop-filter: blur(8px);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--pink); color: var(--navy-900); transform: scale(1.06); }
.icon-btn--onlight { width: 34px; height: 34px; background: rgba(12, 13, 27, 0.82); }

/* ---------- browse (scrolling body) ---------- */

.browse, .results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-500) transparent;
}
.browse { padding: 14px 16px 18px; display: grid; gap: 18px; align-content: start; }

.progress__row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.progress__text { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--butter); letter-spacing: 0.02em; }
.progress__bar { height: 6px; border-radius: 6px; background: var(--glass-strong); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--sunset); transition: width 0.5s var(--ease); }

.block { display: grid; gap: 10px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 32px;
  padding: 0 13px;
  border-radius: 1000px;
  background: var(--navy-500);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.chip:hover { background: var(--peach); color: var(--navy-900); }
.chip b { font-weight: 500; opacity: 0.55; margin-left: 5px; }

.switches { gap: 2px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 7px 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 22px;
  background: var(--navy-500);
  transition: background 0.25s;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lilac-pale);
  transition: transform 0.3s var(--ease), background 0.25s;
}
.switch input:checked + .switch__track { background: var(--pink); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--navy-900); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--butter); outline-offset: 2px; }
.switch__label { font-size: 14px; color: var(--text-soft); }
.switch input:checked ~ .switch__label { color: #fff; }

/* ---------- category groups ---------- */

.groups { display: grid; gap: 10px; }

.group {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  overflow: hidden;
}
.group__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 11px 14px;
  text-align: left;
}
.group__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.group__name {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--butter);
}
.group__count { font-size: 12px; font-weight: 500; color: var(--text-faint); }
.group__eye, .group__chev { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--lilac); transition: background 0.2s, color 0.2s, transform 0.3s var(--ease); }
.group__eye:hover { background: var(--glass-strong); color: #fff; }
.group.is-collapsed .group__chev { transform: rotate(-90deg); }
.group.is-collapsed .group__list { display: none; }
.group.is-off .group__name { color: var(--text-faint); }
.group.is-off .group__dot { background: var(--navy-500); box-shadow: none; }

.group__list { padding: 0 6px 6px; display: grid; gap: 1px; }

.cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 4px 5px 8px;
  border-radius: 12px;
  transition: background 0.15s;
}
.cat:hover { background: var(--glass); }
.cat__toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.cat__icon {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c);
  color: var(--navy-900);
  transition: background 0.2s, color 0.2s;
}
.cat__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 500; }
.cat__count { font-size: 12.5px; font-weight: 500; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.cat__count i { font-style: normal; color: var(--lime); }
.cat__next { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--text-faint); transition: background 0.2s, color 0.2s; }
.cat__next:hover { background: var(--pink); color: var(--navy-900); }
.cat.is-off .cat__icon { background: var(--navy-500); color: var(--text-faint); }
.cat.is-off .cat__name { color: var(--text-faint); text-decoration: line-through; text-decoration-color: rgba(229, 221, 255, 0.25); }
.cat.is-off .cat__count { color: var(--text-faint); }

.sidebar__foot { flex: none; padding: 12px 16px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; background: rgba(7, 8, 16, 0.35); }
.fineprint { font-size: 11.5px; color: var(--text-faint); text-align: center; }

/* ---------- search results ---------- */

.results { padding: 8px 8px 14px; }
.results__meta { padding: 6px 10px 8px; }
.result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
}
.result:hover, .result:focus-visible { background: var(--glass); }
.result__body { min-width: 0; }
.result__title { display: block; font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__sub { display: block; font-size: 12.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results__empty { padding: 28px 16px; text-align: center; color: var(--text-soft); }
.results__empty b { display: block; font-family: var(--font-display); font-size: 24px; text-transform: uppercase; color: var(--butter); letter-spacing: 0.03em; }

/* ---------- floating map chrome ---------- */

.fab {
  position: absolute;
  z-index: 1000;
  top: var(--gap);
  left: var(--gap);
  height: 46px;
  padding: 0 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 1000px;
  background: var(--navy-900);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 500;
}
.fab:hover { background: var(--navy-700); }
.fab__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sunset);
  color: var(--navy-900);
}

.controls {
  position: absolute;
  z-index: 900;
  right: var(--gap);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 8px;
}
.controls .icon-btn { width: 44px; height: 44px; background: rgba(12, 13, 27, 0.9); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(7, 8, 16, 0.4); }
.controls .icon-btn:hover { background: var(--pink); }

.statusbar {
  position: absolute;
  z-index: 900;
  right: var(--gap);
  bottom: var(--gap);
  left: calc(var(--sidebar-w) + 2 * var(--gap));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  transition: left 0.5s var(--ease);
}
.app.is-sidebar-closed .statusbar { left: var(--gap); }
.statusbar > * { pointer-events: auto; padding: 6px 12px; border-radius: 1000px; background: rgba(12, 13, 27, 0.9); font-size: 12px; color: var(--text-soft); }
.coords { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--lilac-pale); white-space: nowrap; }
.attribution { text-align: right; }
.attribution a { color: var(--lilac-pale); }

.placing {
  position: absolute;
  z-index: 950;
  top: var(--gap);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 1000px;
  background: var(--butter);
  color: var(--navy-900);
  font-weight: 500;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.toast {
  position: absolute;
  z-index: 1200;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 1000px;
  background: var(--butter);
  color: var(--navy-900);
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.35s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- map markers ---------- */

.pin-wrap { background: none; border: 0; }
.pin {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c);
  color: var(--navy-900);
  box-shadow: 0 0 0 2px var(--navy-900), 0 4px 10px rgba(7, 8, 16, 0.5);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.leaflet-marker-icon:hover .pin, .leaflet-marker-icon:focus-visible .pin { transform: scale(1.18); box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 5px var(--c), 0 6px 14px rgba(7, 8, 16, 0.55); }
.pin--dot { width: 12px; height: 12px; margin: 9px; box-shadow: 0 0 0 2px var(--navy-900); } /* 2,000 of these: no blurred shadow */
.pin--personal { background: var(--sunset); }
.pin.is-unconfirmed { box-shadow: 0 0 0 2px var(--navy-900), 0 4px 10px rgba(7, 8, 16, 0.5); background: color-mix(in srgb, var(--c) 62%, var(--navy-600)); }
.pin.is-found { opacity: 0.5; }
.pin.is-found::after, .pin.is-fav::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--navy-900);
}
.pin.is-found::after { right: -4px; bottom: -4px; background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0d1b' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat; }
.pin.is-fav::before { right: -4px; top: -4px; background: var(--pink-hot); }
.leaflet-marker-icon.is-active .pin { transform: scale(1.25); box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 5px var(--butter), 0 8px 18px rgba(7, 8, 16, 0.6); }

.cluster-wrap { background: none; border: 0; }
.cluster {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 3px;
  background: var(--sunset);
  box-shadow: 0 6px 16px rgba(7, 8, 16, 0.5);
  transition: transform 0.2s var(--ease);
}
.cluster span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--butter);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.cluster--lg span { font-size: 18px; }
.leaflet-marker-icon:hover .cluster { transform: scale(1.1); }

/* ---------- popup ---------- */

.leaflet-container { font-family: var(--font-body); font-size: 14px; }
.leaflet-container a { color: var(--pink); }
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: var(--radius);
  background: linear-gradient(189deg, #25264a 0%, #18182d 45%, #0c0d1b 100%);
  color: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.leaflet-popup-content { margin: 0; width: 300px !important; line-height: 1.4; }
.leaflet-popup-tip { background: #0c0d1b; box-shadow: none; border: 1px solid var(--line); }
.leaflet-container a.leaflet-popup-close-button {
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 500 20px/1 var(--font-body);
  transition: background 0.2s, color 0.2s;
}
.leaflet-container a.leaflet-popup-close-button:hover { background: var(--pink); color: var(--navy-900); }

.card { padding: 16px 16px 14px; }

/* Photo on top of the card. The sharp image sits whole inside the frame; a blurred copy of
   it fills whatever the frame has left over, so small or tall frames never show bare bars. */
.card__media {
  position: relative;
  margin: -16px -16px 14px;
  aspect-ratio: var(--ar, 16 / 9);
  min-height: 150px;
  max-height: 214px;
  overflow: hidden;
  background: var(--navy-900, #0c0d1b);
}
.card__media-bg { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(18px) brightness(0.55) saturate(1.2); }
.card__photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.card__photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card__photo:focus-visible { outline: 2px solid var(--pink); outline-offset: -3px; }
.card__media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 56px; background: linear-gradient(to top, rgba(12, 13, 27, 0.72), transparent); pointer-events: none; }
.card__switch, .card__badge { position: absolute; left: 10px; bottom: 9px; z-index: 1; }
.card__switch { display: inline-flex; padding: 3px; border-radius: 1000px; background: rgba(12, 13, 27, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card__switch button, .card__badge {
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 1000px; padding: 4px 10px; line-height: 1.2;
}
.card__switch button { border: 0; background: transparent; color: #fff; cursor: pointer; transition: background 0.2s, color 0.2s; }
.card__switch button:hover { color: var(--pink); }
.card__switch button[aria-pressed="true"] { background: var(--pink); color: #0c0d1b; }
.card__badge { background: rgba(12, 13, 27, 0.72); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.leaflet-popup:has(.card__media) a.leaflet-popup-close-button { background: rgba(12, 13, 27, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.leaflet-popup:has(.card__media) a.leaflet-popup-close-button:hover { background: var(--pink); }
.card__media ~ .card__eyebrow { margin-right: 0; }
.card__eyebrow { display: flex; align-items: center; gap: 8px; margin-right: 34px; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c); }
.card__eyebrow .cat__icon { width: 24px; height: 24px; }
.card__title { margin-top: 8px; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 0.98; letter-spacing: 0.01em; text-transform: uppercase; color: var(--butter); overflow-wrap: anywhere; }
.card__area { margin-top: 5px; font-size: 13.5px; color: var(--text-soft); }
.card__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 1000px; background: var(--glass-strong); font-size: 12px; font-weight: 500; color: var(--lilac-pale); }
.tag--lime { background: rgba(230, 255, 163, 0.16); color: var(--lime); }
.tag--warn { background: rgba(255, 212, 168, 0.16); color: var(--peach); }
.card__rl { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.05); }
.card__rl small { display: block; font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lilac); margin-bottom: 3px; }
.card__rl a { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.35; color: #fff; text-decoration: none; }
.card__rl a:hover { color: var(--pink); }
.card__rl a .ic { margin-top: 2px; }
.card__note { margin-top: 10px; font-size: 13.5px; color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.card__actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.card__actions .pill { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; }
.card__actions .icon-btn { width: 36px; height: 36px; background: var(--glass-strong); }
.card__actions .icon-btn:hover { background: var(--pink); }
.card__actions .icon-btn[aria-pressed="true"] { background: var(--pink-hot); color: #fff; }
.card__actions .icon-btn[aria-pressed="true"] svg { fill: currentColor; }
.card__coords { margin-top: 10px; font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.form { display: grid; gap: 8px; margin-top: 10px; }
.form input, .form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--line);
  outline: 0;
  resize: vertical;
}
.form input:focus, .form textarea:focus { border-color: var(--pink); }
.form input::placeholder, .form textarea::placeholder { color: var(--text-faint); }

/* ---------- modal ---------- */

.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(189deg, #1f1f38 0%, #18182d 30%, #111222 65%, #0c0d1b 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(7, 8, 16, 0.7); backdrop-filter: blur(4px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 12px 22px; position: relative; }
.modal__head::after { content: ""; position: absolute; left: 22px; bottom: 0; width: 56px; height: 3px; border-radius: 3px; background: var(--sunset); }
.modal__head h2 { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; text-transform: uppercase; color: var(--butter); }
.modal__body { padding: 16px 22px 22px; display: grid; gap: 12px; color: var(--text-soft); overflow-y: auto; }
.modal__body h3 { margin-top: 6px; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lilac); }
.credits { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.modal .fineprint { text-align: left; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  :root { --gap: 8px; }
  .sidebar { width: auto; right: var(--gap); top: auto; height: min(78vh, 640px); }
  .app.is-sidebar-closed .sidebar { transform: translateY(calc(100% + 2 * var(--gap))); }
  .brand { height: 96px; padding: 12px 16px; }
  .brand__title { font-size: 44px; }
  .brand__mark { display: none; }
  .fab { top: auto; bottom: 44px; }
  .statusbar, .app.is-sidebar-closed .statusbar { left: var(--gap); }
  .coords { display: none; }
  .attribution { font-size: 10.5px; padding: 4px 9px; border-radius: 12px; }
  .controls { top: auto; bottom: 44px; transform: none; }
  .controls #fullscreen { display: none; }
  .leaflet-popup-content { width: 268px !important; }
  .app::after { background: linear-gradient(0deg, rgba(12, 13, 27, 0.4) 0, rgba(12, 13, 27, 0) 18%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- photo viewer ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 64px 24px 24px;
  background: rgba(7, 8, 16, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox__close { position: fixed; top: 16px; right: 16px; }
.lightbox__head { text-align: center; }
.lightbox__title { margin-top: 4px; font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 44px); line-height: 1; text-transform: uppercase; color: var(--butter); }
.lightbox__photos { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 18px; max-width: 100%; }
.lightbox__photos figure { margin: 0; flex: 0 1 auto; max-width: min(100%, 800px); cursor: default; }
.lightbox__photos figure:first-child:nth-last-child(2), .lightbox__photos figure:first-child:nth-last-child(2) ~ figure { max-width: min(100%, 46vw, 800px); }
.lightbox__photos img { display: block; width: auto; height: auto; min-width: min(300px, 100%); max-width: 100%; max-height: 64vh; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: #0c0d1b; }
.lightbox__photos figcaption { margin-top: 9px; font-size: 13px; color: var(--text-soft); max-width: 46ch; }
.lightbox__photos figcaption b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lilac); }

@media (max-width: 760px) {
  .lightbox { justify-content: flex-start; padding: 64px 14px 20px; }
  .lightbox__photos figure:first-child:nth-last-child(2), .lightbox__photos figure:first-child:nth-last-child(2) ~ figure { max-width: 100%; }
  .lightbox__photos img { max-height: none; }
}
