:root {
  --bg: #090b0e;
  --panel: #121418;
  --panel-2: #1a1e24;
  --line: rgba(232, 216, 184, 0.12);
  --text: #e8e4da;
  --muted: #9aa3b2;
  --amber: #c5ccd6;
  --amber-dim: #8b939f;
  --red: #e25b4c;
  --ok: #7dcea0;
  --teal: #2ec4b6;
  --lime: #c8ff00;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#app,
main,
.map-stage,
#map {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "IBM Plex Sans", sans-serif;
}

#app {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px 18px;
  background: linear-gradient(180deg, #16191e 0%, var(--panel) 140px);
  border-right: 1px solid var(--line);
  overflow: auto;
  animation: panel-in 0.45s var(--ease);
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.lede strong {
  color: var(--amber);
  font-weight: 600;
}

.shelved {
  display: none !important;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.stats div {
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform 0.35s var(--ease), border-color 0.25s ease, box-shadow 0.35s var(--ease);
}

.stats div:hover {
  transform: translateY(-2px);
  border-color: rgba(228, 179, 90, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.stats .label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 8px;
  overflow: hidden;
  background: #0c1017;
  border-radius: 99px;
}

#progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  transition: width 0.25s ease;
}

.actions {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
  background: linear-gradient(180deg, #1a212e 70%, rgba(26, 33, 46, 0));
}

button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 11px 12px;
  color: #f4f6f8;
  background: linear-gradient(180deg, #3c4450 0%, #23282f 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.22s ease, opacity 0.2s ease, border-color 0.22s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.16);
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

button.ghost {
  grid-column: span 2;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.ghost:hover:not(:disabled) {
  background: rgba(228, 179, 90, 0.1);
  border-color: rgba(228, 179, 90, 0.35);
}

.text-btn {
  padding: 0;
  color: var(--muted);
  background: none;
  font-weight: 500;
  font-size: 12px;
}

.status {
  min-height: 2.4em;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.inspect {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

#inspect-result {
  display: grid;
  gap: 8px;
}

.inspect-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}

.inspect-card:hover,
.inspect-card.is-selected {
  border-color: rgba(228, 179, 90, 0.5);
}

.inspect-card.is-selected {
  box-shadow: 0 0 0 1px rgba(228, 179, 90, 0.25);
}

.inspect-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
}

.inspect-card button {
  margin-top: 8px;
  padding: 7px 10px;
  font-size: 12px;
}

.ok {
  color: var(--ok);
}

.warn {
  color: var(--amber);
}

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

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.filters label.check,
.filter-advanced label.check,
.map-layers label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease);
}

.filters label.check:hover,
.filter-advanced label.check:hover,
.map-layers label.check:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.filters label.check-wrap {
  align-items: flex-start;
  line-height: 1.35;
}

label.check input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: #0e1114;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}

label.check input:checked {
  background: #d7dde6;
  border-color: #d7dde6;
  animation: check-pop 0.28s var(--ease);
}

label.check input:checked::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #121418;
  border-bottom: 2px solid #121418;
  transform: rotate(-45deg) translateY(-1px);
}

.map-layers h2 {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: #121824;
  font: inherit;
}

.results {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 180px;
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.results h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#lead-list {
  flex: 1;
  margin: 8px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border-top: 1px solid var(--line);
}

#lead-list li {
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s ease, padding-left 0.22s var(--ease);
}

#lead-list li:hover,
#lead-list li.active {
  background: rgba(228, 179, 90, 0.08);
  padding-left: 6px;
}

#lead-list strong {
  display: block;
  font-size: 13.5px;
}

#lead-list span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(226, 91, 76, 0.18);
  color: #ffb1a8;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.badge.dim {
  background: rgba(154, 163, 178, 0.16);
  color: #c5cdd8;
}

.filter-advanced {
  display: grid;
  gap: 8px;
}

#btn-filter-advanced {
  grid-column: auto;
  width: 100%;
}

#filter-advanced-panel {
  display: grid;
  gap: 8px;
}

#filter-advanced-panel[hidden] {
  display: none;
}

#btn-filter-reset,
#btn-replay-tutorial {
  width: 100%;
  margin-top: 4px;
}

.advanced {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

#btn-advanced {
  grid-column: auto;
  width: 100%;
}

#advanced-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

#advanced-panel[hidden] {
  display: none;
}

#advanced-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.key-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 6px;
  align-items: center;
}

.key-row input {
  padding: 8px 9px;
  font-size: 12px;
}

.key-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
}

button.icon-btn {
  min-width: 40px;
  padding: 8px 10px;
  grid-column: auto;
}

button.key-mini {
  min-width: 40px;
  padding: 8px 8px;
  font-size: 13px;
}

button.key-mini.run {
  color: #16110a;
  background: var(--amber);
}

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

.help summary {
  cursor: pointer;
  color: var(--text);
}

main {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.legend {
  position: absolute;
  right: 16px;
  bottom: 78px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  max-width: min(540px, calc(100% - 32px));
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 20, 28, 0.86);
  color: var(--muted);
  font-size: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: hud-in 0.5s var(--ease) both;
}

.map-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 520;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(420px, calc(100% - 72px));
  animation: hud-in 0.45s var(--ease) both;
}

.hud-btn {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(16, 20, 28, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  font-size: 12.5px;
  font-weight: 600;
  grid-column: auto;
  white-space: nowrap;
}

.hud-btn.on,
.hud-btn[aria-pressed="true"] {
  color: #16110a;
  background: linear-gradient(180deg, #f0c56e 0%, var(--amber) 80%);
  border-color: transparent;
}

.streetview-hint {
  position: absolute;
  top: 62px;
  left: 16px;
  z-index: 520;
  margin: 0;
  max-width: min(420px, calc(100% - 32px));
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(16, 20, 28, 0.88);
  border: 1px solid rgba(228, 179, 90, 0.35);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: hud-in 0.35s var(--ease) both;
}

.earth-timeline {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 520;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100% - 36px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  animation: timeline-in 0.55s var(--ease) both;
}

.earth-timeline.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.timeline-play {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 13px;
  grid-column: auto;
}

#imagery-time {
  flex: 1;
  height: 4px;
  padding: 0;
  accent-color: var(--amber);
  cursor: pointer;
}

#imagery-date {
  min-width: 72px;
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: right;
}

.streetview-on {
  cursor: crosshair;
}

.leaflet-container.identify-on {
  cursor: pointer;
}

body.leaflet-dragging .leaflet-container.identify-on {
  cursor: grabbing;
}

.parcel-tile {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 0.6px #fff6c8) drop-shadow(0 0 3px #ffd36a) drop-shadow(0 0 10px rgba(228, 179, 90, 0.7));
  animation: parcel-glow 2.8s ease-in-out infinite;
}

@keyframes parcel-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 0.6px #fff6c8) drop-shadow(0 0 3px #ffd36a) drop-shadow(0 0 8px rgba(228, 179, 90, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 1px #fff8d6) drop-shadow(0 0 6px #ffe08a) drop-shadow(0 0 14px rgba(255, 210, 96, 0.85));
  }
}

@keyframes hud-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timeline-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

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

  .panel-body {
    transition: none !important;
  }
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.dot.amber {
  background: #e4b35a;
}

.dot.red {
  background: var(--red);
}

.dot.gray {
  background: #8b95a5;
}

.dot.purple {
  background: #b38bff;
}

.dot.teal {
  background: var(--teal);
}

.dot.lime {
  background: var(--lime);
}

.dot.dim {
  background: #6b7380;
  opacity: 0.7;
}

.dot.abandoned {
  background: #b06cff;
}

.dot.withdrawn {
  background: #f2c200;
}

.pin.abandoned span {
  background: #b06cff;
  box-shadow: 0 0 12px rgba(176, 108, 255, 0.9);
}

.pin.withdrawn span {
  background: #f2c200;
  box-shadow: 0 0 12px rgba(242, 194, 0, 0.85);
}

.pin {
  background: none !important;
  border: 0 !important;
}

.pin span {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #e4b35a;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  transform: rotate(-45deg);
}

.leaflet-zoom-anim .leaflet-zoom-animated {
  will-change: auto;
}

.leaflet-countyMaskPane-pane,
.leaflet-countyShadowPane-pane,
.leaflet-countyPane-pane,
.leaflet-countyLabelPane-pane {
  pointer-events: none;
}

.county-cover {
  pointer-events: none;
  overflow: visible;
  transform-origin: 0 0;
}

.leaflet-countyShadowPane-pane {
  filter: blur(7px);
}

.county-soon-icon {
  background: none !important;
  border: 0 !important;
}

.county-soon {
  width: 140px;
  margin-left: -70px;
  margin-top: -22px;
  text-align: center;
  color: #4a5360;
  font-family: "IBM Plex Sans", sans-serif;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 10px rgba(230, 234, 240, 0.95);
}

.county-soon strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.county-soon em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6d7682;
}

.pin.vacant span {
  background: var(--red);
}

.pin.lot span {
  background: #8b95a5;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.pin.powered span {
  background: var(--teal);
  box-shadow: 0 0 10px rgba(46, 196, 182, 0.75);
}

.pin.connected-off span,
.pin.dark-vacant span {
  background: var(--lime);
  box-shadow: 0 0 12px rgba(200, 255, 0, 0.9);
}

.pin.dark-nostat span {
  background: var(--red);
  box-shadow: 0 0 10px rgba(226, 91, 76, 0.7);
}

.pin.dark-removed span {
  background: #6b7380;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.pin.not-connected {
  opacity: 0.48;
}

.pin.not-connected span {
  background: #6b7380;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.pin.lookup span {
  background: #6ec8e8;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #171b20;
  color: #f4f6f8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

@media (hover: hover) and (pointer: fine) {
  .leaflet-popup-content-wrapper.popup-draggable {
    cursor: grab;
  }

  .leaflet-popup-content-wrapper.popup-draggable.is-dragging,
  .resident-card.is-dragging header {
    cursor: grabbing;
  }

  .resident-card header {
    cursor: grab;
  }
}

.leaflet-popup-content {
  margin: 14px 16px 12px;
  line-height: 1.4;
}

.leaflet-popup-close-button {
  z-index: 2;
  color: #c5ccd6 !important;
  font-size: 18px !important;
}

body.spot-focus .panel,
body.spot-focus .legend,
body.spot-focus .map-hud,
body.spot-focus .earth-timeline,
body.spot-focus .streetview-hint,
body.spot-focus .leaflet-control-container,
body.spot-focus #resident-card {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.spot-focus .leaflet-popup,
body.spot-focus .leaflet-popup-pane,
body.spot-focus #photo-gallery,
body.spot-focus #profile-view,
body.spot-focus .auth-dialog {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.spot-focus .leaflet-popup-content {
  max-height: min(68vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  body.spot-focus .panel {
    /* Stay in layout so the map size/center does not jump. */
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .spot-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2590;
    background: rgba(4, 6, 10, 0.45);
  }

  body.spot-focus .leaflet-popup.spot-popup-centered {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    max-width: min(92vw, 380px) !important;
    width: min(92vw, 380px) !important;
    z-index: 2600 !important;
  }

  body.spot-focus .leaflet-popup.spot-popup-centered .leaflet-popup-content-wrapper {
    max-width: min(92vw, 380px);
    width: 100%;
  }

  body.spot-focus .leaflet-popup.spot-popup-centered .leaflet-popup-tip-container {
    display: none;
  }

  body.spot-focus .leaflet-popup.spot-popup-centered .leaflet-popup-content {
    max-height: min(70dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 48px));
    width: auto !important;
  }

  body.spot-focus .leaflet-popup.spot-popup-centered .popup-zoom {
    top: 8px;
    left: 8px;
  }
}

.popup-zoom {
  position: absolute;
  top: -12px;
  left: 10px;
  z-index: 5;
  display: none;
  gap: 4px;
}

body.spot-focus .popup-zoom {
  display: flex;
}

.popup-zoom button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1c2229;
  color: #f4f6f8;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.popup-zoom button:hover {
  background: #2a313a;
}

.spot-photo img.is-broken {
  outline: 1px solid rgba(231, 179, 179, 0.7);
  background:
    linear-gradient(135deg, transparent 45%, rgba(231, 179, 179, 0.55) 45%, rgba(231, 179, 179, 0.55) 55%, transparent 55%),
    #2a313a;
}

.popup {
  min-width: 240px;
  color: #f4f6f8;
  font-family: "IBM Plex Sans", sans-serif;
}

.popup h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.popup .copy-address {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0 0 0 6px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: #9aa3b2;
  vertical-align: -2px;
}

.popup .copy-address svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.popup .copy-address.copy-sm {
  width: 13px;
  height: 13px;
  margin-left: 4px;
  vertical-align: -1px;
}

.popup .copy-address.copy-sm svg {
  width: 11px;
  height: 11px;
}

.popup .copy-address.is-copied {
  width: auto;
  height: auto;
  color: #d7dee7;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.popup .copy-address.copy-sm.is-copied {
  font-size: 10px;
}

.popup .copy-address:hover:not(:disabled),
.popup .copy-address:active:not(:disabled) {
  transform: none;
  box-shadow: none;
  filter: none;
  background: transparent;
  color: #f4f6f8;
}

.popup .found-note {
  margin: 0 0 8px;
  color: #f2c200;
  font-weight: 600;
}

.popup p {
  margin: 0 0 8px;
  color: #b7c0cc;
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.popup-actions a,
.popup-actions button {
  color: #e7edf4;
  font-weight: 600;
}

.popup-actions button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  cursor: pointer;
}

.popup-actions button:disabled {
  opacity: 0.7;
}

.pin-meanings {
  margin: 0 0 8px;
  color: #b7c0cc;
  font-size: 13px;
}

.pin-meanings summary {
  color: #3a414c;
  font-weight: 600;
  cursor: pointer;
}

.pin-meanings ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.pin-meanings li {
  margin: 0 0 6px;
}

.abandon-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.abandon-dialog::backdrop {
  background: rgba(8, 10, 14, 0.55);
}

.abandon-dialog h3 {
  margin: 0 0 6px;
}

.abandon-dialog label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 13px;
}

.abandon-dialog input[type="text"],
.abandon-dialog textarea,
.abandon-dialog input[type="file"] {
  width: 100%;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.abandon-dialog textarea {
  resize: vertical;
  min-height: 58px;
  font: inherit;
}

.spot-blurb {
  margin: 0 0 8px;
  color: #d7dee7;
  line-height: 1.4;
}

.abandon-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#abandoned-photos-label[hidden],
.abandon-photos[hidden],
#abandoned-photo-help[hidden],
#abandoned-photo-help-note[hidden] {
  display: none !important;
}

.photo-help {
  margin: -6px 0 12px;
}

.photo-help button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #9aa3b2;
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
}

.photo-help button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  filter: none;
  color: #f4f6f8;
}

.photo-help span {
  display: block;
  margin-top: 4px;
  color: #c5ccd6;
  font-size: 12px;
}

.abandon-photos label {
  position: relative;
  margin: 0;
}

.abandon-photos img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
}

.abandon-photos input {
  position: absolute;
  top: 4px;
  left: 4px;
}

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

.popup-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.popup-photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
}

.photo-rest {
  display: none !important;
}

.popup .photo-more {
  width: 88px;
  min-height: 72px;
  padding: 8px;
  border-radius: 8px;
  background: #23282f;
  box-shadow: none;
  color: #d7dee7;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}

.popup .photo-more:hover:not(:disabled),
.popup .photo-like:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.spot-photo .photo-like {
  top: auto;
  right: auto;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(18, 22, 27, 0.86);
  box-shadow: none;
  color: #f4f6f8;
  font-size: 10px;
}

.gallery-like {
  display: block;
  margin: 8px auto 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #2a313a;
  box-shadow: none;
  font-size: 13px;
}

.level-up {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.level-up:not([open]) {
  display: none;
}

.welcome:not([open]) {
  display: none;
}

.welcome {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

@supports not (height: 100dvh) {
  .welcome {
    height: 100vh;
    max-height: 100vh;
  }
}

.welcome::backdrop {
  background: rgba(6, 8, 12, 0.72);
}

.welcome-card {
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 24px));
  max-height: min(calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)), calc(100vh - 24px));
  overflow: hidden;
  padding: 18px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #171b20;
  color: #f4f6f8;
  box-sizing: border-box;
}

.welcome-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.welcome-step {
  margin: 0;
  color: #9aa3b2;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.welcome-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(36vh, 280px);
  margin: 12px 0 0;
  border-radius: 12px;
  object-fit: contain;
  background: #101419;
}

.welcome-card img[hidden] {
  display: none !important;
}

.welcome-card h3 {
  margin: 14px 0 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.welcome-body {
  margin-top: 10px;
  color: #d7dee7;
  line-height: 1.45;
}

.welcome-body p {
  margin: 0 0 10px;
}

.welcome-body ol {
  margin: 0 0 10px;
  padding-left: 1.2em;
}

.welcome-body li {
  margin: 0 0 8px;
}

.welcome-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.welcome-actions button {
  min-height: 44px;
  padding: 10px 16px;
}

.welcome-actions button[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .welcome {
    align-items: end;
    padding: 10px 10px calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .welcome-card {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 74px - env(safe-area-inset-bottom, 0px));
    padding: 14px 14px 12px;
  }

  @supports not (height: 100dvh) {
    .welcome-card {
      max-height: calc(100vh - 74px);
    }
  }

  .welcome-card h3 {
    font-size: 18px;
  }

  .welcome-card img {
    max-height: min(28vh, 200px);
    margin-top: 10px;
  }

  .welcome-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 10px;
    padding-bottom: 2px;
    background: #171b20;
  }
}

.level-up::backdrop {
  background: rgba(6, 8, 12, 0.72);
}

.level-up-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 40px));
  padding: 28px 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #171b20;
  color: #f4f6f8;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.level-up-card[hidden] {
  display: none !important;
}

.level-up-card h3 {
  margin: 8px 0 0;
  font-size: 22px;
}

.level-up-card p {
  margin: 10px 0 0;
  color: #d7dee7;
  line-height: 1.45;
}

.level-up-kicker {
  margin: 12px 0 0;
  color: #e4b35a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-up-rank {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.level-up-person {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.level-up-person .avatar,
.level-up-person .avatar-letter {
  width: 84px;
  height: 84px;
  border-radius: 50%;
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: none;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(88vh) rotate(280deg); opacity: 0.2; }
}

.photo-gallery {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 52px 64px 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #12161b;
  color: #f4f6f8;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.photo-gallery::backdrop {
  background: rgba(6, 8, 12, 0.78);
}

.photo-gallery .gallery-stage {
  position: relative;
}

.photo-gallery .gallery-stage > img {
  display: block;
  width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: 10px;
  background: #0c0e12;
}

.gallery-credit {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 4px 10px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 14, 18, 0.82);
  color: #f4f6f8;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.gallery-credit img {
  width: 22px;
  height: 22px;
  max-height: none;
  border-radius: 50%;
  object-fit: cover;
}

.gallery-credit[hidden] {
  display: none !important;
}

.photo-gallery .gallery-close,
.photo-gallery .gallery-nav {
  position: absolute;
  border: 0;
  background: #2a313a;
  color: #f4f6f8;
}

.photo-gallery .gallery-close {
  top: 12px;
  right: 12px;
  padding: 6px 10px;
}

.photo-gallery .gallery-nav {
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.photo-gallery .gallery-prev {
  left: 12px;
}

.photo-gallery .gallery-next {
  right: 12px;
}

.photo-gallery .gallery-nav[hidden] {
  display: none;
}

.gallery-count {
  margin: 10px 0 0;
  text-align: center;
  color: #c5ccd6;
  font-size: 13px;
}

.badge.powered {
  background: rgba(46, 196, 182, 0.2);
  color: #8ef0e6;
}

.badge.off {
  background: rgba(200, 255, 0, 0.18);
  color: #d6ff5c;
}

.duke-block h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.duke-actions {
  position: static;
  padding-top: 0;
  background: none;
}

.duke-count {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(197, 204, 214, 0.22);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  color: #121418;
  background: #d7dde6;
  font-family: "IBM Plex Sans", sans-serif;
}

.leaflet-control-layers {
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(16, 20, 28, 0.92) !important;
  color: var(--text);
}

@media (max-width: 720px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel {
    position: relative;
    z-index: 700;
    max-height: none;
    padding: 10px 12px 8px;
    gap: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    background: linear-gradient(180deg, #16191e 0%, var(--panel) 100%);
  }

  .panel-chrome {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
  }

  .panel-close {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(24, 28, 34, 0.92);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    box-shadow: var(--shadow);
  }

  .panel-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 42px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(28, 32, 38, 0.95);
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  .panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 0.42s var(--ease),
      opacity 0.28s ease,
      margin-top 0.28s ease,
      padding-top 0.28s ease;
  }

  .panel[data-panel-collapsed] .panel-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .panel:not([data-panel-collapsed]) {
    max-height: min(92vh, 100dvh);
  }

  .panel:not([data-panel-collapsed]) .panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .panel:not([data-panel-collapsed]) .panel-expand {
    display: none;
  }

  .panel:not([data-panel-collapsed]) .panel-body {
    max-height: min(78vh, calc(100dvh - 120px));
    opacity: 1;
    margin-top: 10px;
    padding-top: 4px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
  }

  .panel:not([data-panel-collapsed]) .account-bar {
    padding-right: 40px;
  }

  .lede {
    display: none;
  }

  .earth-timeline {
    display: none !important;
  }

  .legend {
    left: 50%;
    right: auto;
    bottom: 10px;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 20px);
    gap: 4px 8px;
    padding: 5px 8px;
    border-radius: 12px;
    font-size: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .legend .dot {
    width: 7px;
    height: 7px;
  }

  .map-hud {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 56px);
  }

  .hud-btn {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

@media (min-width: 721px) {
  .panel-close,
  .panel-expand {
    display: none !important;
  }

  .panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

.resident-card {
  position: fixed;
  z-index: 1200;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 14px 16px 8px;
  border: 1px solid rgba(36, 32, 24, 0.16);
  border-radius: 16px;
  background: #fffdf8;
  color: #1b1a17;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-family: "IBM Plex Sans", sans-serif;
}

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

.resident-card h3 {
  margin: 0;
  font-size: 16px;
}

.resident-card h4 {
  margin: 12px 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3a414c;
}

.resident-card header button {
  padding: 0;
  border: 0;
  background: none;
  color: #3a414c;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.resident-card p,
.resident-card li {
  margin: 0 0 8px;
  color: #3d3a34;
  line-height: 1.4;
}

.resident-card .resident-age,
.resident-card .resident-where {
  color: #5b564c;
}

.resident-card article {
  padding-top: 8px;
  border-top: 1px solid rgba(36, 32, 24, 0.1);
}

.resident-card article:first-of-type {
  border-top: 0;
}

.resident-facts div {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.resident-facts span {
  color: #6d675c;
}

.resident-card ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.resident-card a {
  color: #3a414c;
  font-weight: 600;
}

.resident-cloudflare {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: #f6821f;
  color: #1b1a17;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes check-pop {
  50% {
    transform: scale(1.12);
  }
}

.pin.tier-bronze span { background: #b87333; box-shadow: 0 0 12px rgba(184, 115, 51, 0.85); }
.pin.tier-silver span { background: #d5dbe3; box-shadow: 0 0 12px rgba(213, 219, 227, 0.9); }
.pin.tier-gold span { background: #e0b44a; box-shadow: 0 0 12px rgba(224, 180, 74, 0.9); }
.pin.tier-platinum span { background: #9fd4e8; box-shadow: 0 0 12px rgba(159, 212, 232, 0.95); }
.pin.tier-diamond span { background: #7ee7ff; box-shadow: 0 0 14px rgba(126, 231, 255, 1); }

.account-bar {
  animation: panel-in 0.4s var(--ease);
}

.account-guest,
.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #232830 0%, #171b20 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.account-guest {
  flex-direction: column;
  align-items: stretch;
}

.account-guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-guest .auth-logo {
  width: 100%;
  margin: 0 0 4px;
}

.account-guest span,
.account-card em,
.account-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.account-card strong,
.account-guest strong {
  display: block;
  font-size: 15px;
}

.account-meta {
  margin: 8px 2px 0;
}

.user-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.xp-track {
  --rank: #9aa3b2;
  --rank-dim: #5c6572;
  display: block;
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #0c0e12;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rank) 40%, transparent);
}

.xp-track.rank-starter { --rank: #9aa3b2; --rank-dim: #5c6572; }
.xp-track.rank-bronze { --rank: #cd7f32; --rank-dim: #8a5a22; }
.xp-track.rank-silver { --rank: #c0c6d0; --rank-dim: #8d95a3; }
.xp-track.rank-gold { --rank: #e0b44a; --rank-dim: #a07a22; }
.xp-track.rank-platinum { --rank: #b8d4e8; --rank-dim: #6f95ad; }
.xp-track.rank-diamond { --rank: #7ee7ff; --rank-dim: #3aa8c4; }

.xp-track > span {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rank-dim), var(--rank));
  box-shadow: 0 0 12px color-mix(in srgb, var(--rank) 75%, transparent);
  transition: width 0.6s var(--ease);
}

.xp-track > span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.55) 50%, transparent 72%);
  transform: translateX(-130%);
  animation: xp-shine 2.6s ease-in-out infinite;
}

@keyframes xp-shine {
  0% { transform: translateX(-130%); }
  55%, 100% { transform: translateX(140%); }
}

.rank-badge {
  --rank: #9aa3b2;
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--rank);
  box-shadow: 0 0 6px var(--rank);
  transform: rotate(45deg);
  animation: rank-glow 2.2s ease-in-out infinite;
}

.rank-badge.rank-bronze { --rank: #cd7f32; }
.rank-badge.rank-silver { --rank: #c0c6d0; }
.rank-badge.rank-gold { --rank: #e0b44a; }
.rank-badge.rank-platinum { --rank: #b8d4e8; }
.rank-badge.rank-diamond { --rank: #7ee7ff; }

@keyframes rank-glow {
  0%, 100% { box-shadow: 0 0 4px var(--rank); }
  50% { box-shadow: 0 0 12px var(--rank); }
}

.spot-photo {
  position: relative;
  margin: 0;
}

.spot-photo img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.spot-photo button {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 6px;
  font-size: 11px;
}

.comment-top [data-comment-delete] {
  color: #e7b3b3;
  font-size: 11px;
}

.leaflet-popup-content .spot-actions button,
.leaflet-popup-content .visit-btn,
.leaflet-popup-content .author-chip {
  background: #2a313a;
}

.leaflet-popup-content .comment-compose input {
  background: transparent;
  color: #f4f6f8;
  border: 0;
}

.avatar-drop[hidden],
.avatar-crop[hidden],
.profile-pins[hidden] {
  display: none !important;
}

.avatar-drop {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  padding: 16px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: #0c0e12;
  color: #c5ccd6;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
}

.avatar-drop:has(img) {
  padding: 0;
  overflow: hidden;
  border-style: solid;
}

.avatar-drop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.spots-toggle {
  margin-top: 12px;
}

.spots-toggle.on {
  background: #2a313a;
}

.avatar-crop {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.avatar-crop canvas {
  width: min(100%, 280px);
  height: auto;
  border-radius: 16px;
  background: #0c0e12;
  cursor: grab;
  touch-action: none;
}

.avatar-crop canvas:active {
  cursor: grabbing;
}

.avatar-hint {
  margin: 0;
  max-width: 280px;
  color: #8b939f;
  font-size: 12px;
  line-height: 1.4;
}

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

.avatar-save.glow {
  background: #2f6dff;
  border-color: #9ec4ff;
  box-shadow: 0 0 0 1px #7eb6ff, 0 0 16px rgba(47, 109, 255, 0.85);
  animation: save-glow 1.3s ease-in-out infinite;
}

@keyframes save-glow {
  0%, 100% { box-shadow: 0 0 0 1px #7eb6ff, 0 0 10px rgba(47, 109, 255, 0.55); }
  50% { box-shadow: 0 0 0 1px #d6e8ff, 0 0 22px rgba(47, 109, 255, 0.95); }
}

.avatar-cancel {
  background: #9a2d2d;
  border-color: #e7a0a0;
  color: #fff;
}

.avatar-note {
  margin: 0;
}

.avatar,
.avatar-letter {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #2a3038;
  color: #f4f6f8;
  font-weight: 600;
}

.auth-dialog,
.profile-card {
  color: var(--text);
  background: #14181d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.auth-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-logo {
  display: block;
  width: min(100%, 340px);
  height: auto;
  margin: 0 auto 14px;
  mix-blend-mode: lighten;
}

.auth-browser-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(228, 179, 90, 0.45);
  background: rgba(228, 179, 90, 0.12);
  color: #f0c56e;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.auth-dialog::backdrop,
.profile-view {
  background: rgba(6, 8, 10, 0.62);
}

html.site-loading #site-loader {
  display: flex !important;
}

#site-loader:not([hidden]) {
  display: flex;
}

.site-loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  background: #090b0e;
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}

html.site-loading #app,
html.site-loading .leaflet-container {
  visibility: hidden !important;
  pointer-events: none !important;
}

.site-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 32px;
  text-align: center;
}

.site-loader-card p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #d7dde6;
}

.site-loader-spin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(215, 221, 230, 0.18);
  border-top-color: #d7dde6;
  animation: site-loader-spin 0.75s linear infinite;
}

@keyframes site-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-loader-spin {
    animation: none;
    border-top-color: rgba(215, 221, 230, 0.18);
    border-right-color: #d7dde6;
  }
}

body.signed-out #app {
  pointer-events: none;
  user-select: none;
}

.google-auth {
  width: 100%;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  color: #1f1f1f;
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-dialog label,
.profile-edit label {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.auth-dialog input,
.auth-dialog select,
.profile-edit input,
.profile-edit textarea,
.abandon-dialog select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  background: #0e1114;
  font: inherit;
}

.profile-edit textarea {
  min-height: 72px;
  resize: vertical;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.auth-tabs button {
  flex: 1;
  padding: 8px;
  background: transparent;
  box-shadow: none;
}

.auth-tabs button.on {
  background: #2c333c;
}

.recovery-key {
  margin: 8px 0 14px;
  padding: 14px;
  border-radius: 12px;
  background: #0e1114;
  color: #f4f6f8;
  font-family: "IBM Plex Mono", monospace;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-align: center;
}

.profile-view {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.profile-view[hidden] {
  display: none;
}

.profile-card {
  width: min(560px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  animation: panel-in 0.35s var(--ease);
}

.profile-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.profile-head:has(.avatar-crop:not([hidden])) {
  flex-wrap: wrap;
}

.profile-head:has(.avatar-crop:not([hidden])) .avatar-picker {
  flex: 1 1 100%;
}

.avatar-picker {
  flex: 0 0 auto;
}

.profile-head h3,
.profile-edit h4,
.profile-card h4 {
  margin: 0 0 4px;
}

.profile-bio {
  margin: 14px 0 4px;
  color: #d7dee7;
  line-height: 1.45;
  white-space: pre-wrap;
}

.author-bio {
  display: block;
  margin-top: 4px;
  color: #d7dee7;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: pre-wrap;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-links a,
.profile-pins button,
#admin-results button {
  color: var(--text);
  background: #222830;
  box-shadow: none;
}

.profile-pins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.spot-social {
  margin: 8px 0;
}

.author-chip,
.spot-comments button,
.spot-actions button,
.visit-btn {
  color: #f4f6f8;
  background: #1b2026;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  text-align: left;
}

.author-chip .user-name,
.author-chip em {
  display: flex;
  font-style: normal;
}

.author-chip em {
  display: block;
}

.author-chip em,
.spot-quota,
.spot-unclaimed {
  color: #8b939f;
  font-size: 12px;
}

.spot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spot-actions button,
.visit-btn {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.spot-thread {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #0e1217;
}

.spot-comments {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spot-comments li {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spot-thread > .spot-comments li:last-child {
  border-bottom: 0;
}

.comment-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.comment-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #f4f6f8;
  font-weight: 600;
  text-align: left;
}

.comment-who .avatar,
.comment-who .avatar-letter {
  width: 22px;
  height: 22px;
}

.comment-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.comment-tools button {
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: #171c22;
  color: #d5dbe3;
  font-size: 11px;
  box-shadow: none;
}

.comment-text {
  margin: 6px 0 0 28px;
  color: #d7dee7;
  line-height: 1.4;
}

.comment-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.comment-trash,
.comment-reply-btn,
.reply-target button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1;
}

.comment-trash {
  display: inline-flex;
  color: #e7b3b3;
}

.comment-reply-btn,
.reply-target button {
  color: #9ec4ff;
  font-size: 12px;
  font-weight: 600;
}

.spot-comments li.is-reply {
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.spot-thread > .spot-comments + .comment-compose {
  margin-top: 14px;
}

.comment-compose {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.reply-target {
  flex: 1 0 100%;
  margin: 0;
  padding: 8px 12px 0;
  color: #9ec4ff;
  font-size: 12px;
}

.spot-thread > .comment-compose:first-child {
  border-top: 0;
}

.comment-compose input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f4f6f8;
  font: inherit;
}

.comment-compose > button {
  padding: 10px 14px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: #1b222a;
  color: #f4f6f8;
  box-shadow: none;
}

.comment-who:hover,
.comment-tools button:hover,
.comment-trash:hover,
.comment-reply-btn:hover,
.reply-target button:hover,
.comment-compose > button:hover {
  transform: none;
  filter: none;
  box-shadow: none;
}

.xp-help {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.xp-help summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

