/* Shanghai Spotters v2.0 — UI Components, Map HUD, Cards, Lightbox, Wizard & Admin */

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--line-accent); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-dim), var(--panel2));
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 4px 18px var(--accent-dim);
}
.btn-primary:hover { box-shadow: 0 0 0 1px var(--accent), 0 6px 22px var(--accent-glow); }

.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line2); background: var(--panel2); }

.btn-danger {
  border-color: rgba(255, 92, 124, 0.48);
  color: var(--danger);
  background: var(--danger-dim);
}
.btn-danger:hover { border-color: var(--danger); }

.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- inputs */
.label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 700;
  margin: 0 0 6px 2px;
}

.input,
.textarea,
select.input {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--radius-s);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus,
.textarea:focus,
select.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--muted2); }
.textarea { resize: vertical; min-height: 76px; }
input[type="date"].input { color-scheme: dark; }
[data-theme="light"] input[type="date"].input { color-scheme: light; }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }
.hint { font-size: 11.5px; color: var(--muted2); margin-top: 5px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; font-weight: 500; }

/* ----------------------------------------------------------------- chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  cursor: default;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.chip { cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
button.chip:hover { color: var(--text); border-color: var(--line-accent); }
.chip.on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}
.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
[data-theme="light"] .chip-dot { border-color: rgba(15, 23, 42, 0.25); }

.active-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
}
.active-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-dim);
  border: 1px solid var(--line-accent);
  color: var(--accent);
  cursor: pointer;
}
.active-pill:hover { filter: brightness(1.12); }

/* --------------------------------------------------- sidebar / filters */
.panel-section { margin-bottom: 20px; }
.side-search { position: relative; }
.side-search .input { padding-left: 36px; padding-right: 30px; }
.side-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted2);
  pointer-events: none;
}
.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.search-clear-btn:hover { color: var(--text); }

.search-slots-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.search-slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--line-accent);
  color: var(--accent);
}
.search-slot-chip.chip-model { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.search-slot-chip.chip-color { background: var(--ok-dim); border-color: var(--ok); color: var(--ok); }
.search-slot-chip.chip-year { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }

.filters-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-title {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.filters-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--line-accent);
  padding: 1px 8px;
  border-radius: 999px;
}
.filters-clear {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.filters-clear:hover { color: var(--danger); }

.color-field { position: relative; }
.color-field .input { padding-right: 38px; }
.color-swatch {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 8px 0 var(--sw, transparent);
}

/* dual range slider */
.range { position: relative; height: 28px; margin: 4px 2px 2px; }
.range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 4px;
  border-radius: 4px;
  background: var(--panel2);
}
.range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: 4px;
}
.range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none;
  height: 28px;
}
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1.5px var(--accent);
  pointer-events: auto;
  cursor: grab;
}
.range input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1.5px var(--accent);
  pointer-events: auto;
  cursor: grab;
}
.range-vals {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* sidebar feeds */
.feed-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.feed-link { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.feed-link:hover { text-decoration: underline; }
.feed-list { display: flex; flex-direction: column; gap: 6px; }
.feed-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.feed-item:hover { background: var(--panel); border-color: var(--line); }
.feed-thumb {
  width: 54px;
  height: 40px;
  border-radius: 7px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.feed-thumb img,
.feed-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.feed-info { min-width: 0; flex: 1; }
.feed-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-meta { font-size: 11.5px; color: var(--muted2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-empty { font-size: 12.5px; color: var(--muted2); padding: 4px 2px; }

/* --------------------------------------------------------- map controls */
#mapControls { position: absolute; inset: 0; z-index: 900; pointer-events: none; }
#mapControls > * { pointer-events: auto; }

.map-top-left {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  max-width: min(72vw, 340px);
}

.map-badge {
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-float);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.map-badge b { color: var(--accent); font-weight: 700; }

.time-pill {
  display: inline-flex;
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  box-shadow: var(--shadow-float);
}
.time-pill button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
}
.time-pill button:hover { color: var(--text); }
.time-pill button.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line-accent);
}

.region-jumper {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 3px 5px;
  box-shadow: var(--shadow-float);
  z-index: 860;
  max-width: calc(100vw - 680px);
  overflow-x: auto;
  scrollbar-width: none;
}
.region-jumper::-webkit-scrollbar { display: none; }
.region-jumper button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.15s;
}
.region-jumper button:hover { color: var(--text); background: var(--bg3); }
.region-jumper button.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line-accent);
}

.map-top-right {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.mode-pill,
.provider-pill {
  display: flex;
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-float);
  gap: 2px;
}
.mode-pill button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
}
.provider-pill button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.mode-pill button.active,
.provider-pill button.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line-accent);
}

.fab {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-float);
  background: var(--panel-glass);
  backdrop-filter: blur(10px);
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.fab:hover { transform: translateY(-2px); border-color: var(--accent); }
.fab-upload {
  right: 16px;
  bottom: 96px;
  width: 52px;
  height: 52px;
  font-size: 25px;
  border-color: var(--accent);
  color: var(--accent);
}
.fab-snapshot {
  right: 20px;
  bottom: 160px;
  width: 44px;
  height: 44px;
  color: var(--muted);
}
.fab-snapshot svg { width: 19px; height: 19px; }
.fab-snapshot:hover { color: var(--text); }
.fab-filter {
  left: 16px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  color: var(--text);
}
.fab-filter svg { width: 20px; height: 20px; }
.fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #07090d;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* radar sweep & HUD */
.radar-sweep-overlay {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 2;
  background: conic-gradient(from 0deg at 50% 50%, rgba(56, 232, 255, 0.06) 0deg, rgba(56, 232, 255, 0) 40deg);
  animation: radarSweep 18s linear infinite;
  opacity: 0.65;
}
[data-theme="light"] .radar-sweep-overlay { opacity: 0.25; }

.map-hud {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 6px 18px;
  z-index: 500;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
  box-shadow: var(--shadow-float);
  white-space: nowrap;
}
.hud-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 2s ease-in-out infinite;
}
.map-hud .hud-coords { color: var(--accent); }
.map-hud .hud-targets { color: var(--gold); }
.map-hud .hud-sep { opacity: 0.4; }

/* Leaflet & custom radar cluster styles */
.leaflet-container { font-family: var(--font-body); background: var(--bg) !important; }
[data-theme="dark"] #map[data-map-provider="autonavi"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.86) contrast(1.08) saturate(0.7);
}
[data-theme="dark"] #map[data-map-provider="sat"] .leaflet-tile-pane {
  filter: brightness(0.92) contrast(1.08);
}

.pin-wrap { background: none; border: none; position: relative; }
.pin {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pin, var(--accent));
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 12px 2px var(--pin, var(--accent));
  position: relative;
  z-index: 2;
  transition: transform 0.15s ease;
}
.pin-wrap:hover .pin { transform: scale(1.25); }
.pin-pulse {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--pin, var(--accent));
  animation: pinPulseWave 2.2s cubic-bezier(0.1, 0.8, 0.2, 1) infinite;
  pointer-events: none;
  z-index: 1;
}

/* Custom Neon Radar MarkerCluster */
.ss-cluster { background: transparent !important; }
.ss-cluster-badge {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12px;
  color: #07090d;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 5px var(--cluster-ring), 0 6px 18px rgba(0, 0, 0, 0.5);
  background: var(--cluster-bg);
  transition: transform 0.16s ease;
}
.ss-cluster:hover .ss-cluster-badge { transform: scale(1.1); }
.ss-cluster-sm { --cluster-bg: #38e8ff; --cluster-ring: rgba(56, 232, 255, 0.28); }
.ss-cluster-md { --cluster-bg: #eab967; --cluster-ring: rgba(234, 185, 103, 0.3); }
.ss-cluster-lg { --cluster-bg: #ff6b8b; --cluster-ring: rgba(255, 107, 139, 0.34); color: #ffffff; }

/* Map Popup */
.ss-pop .leaflet-popup-content-wrapper {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 0;
  overflow: hidden;
}
.ss-pop .leaflet-popup-tip { background: var(--panel); border: 1px solid var(--line2); }
.ss-pop .leaflet-popup-content { margin: 0; min-width: 286px; max-width: 330px; }
.ss-pop a.leaflet-popup-close-button {
  color: #fff;
  background: rgba(7, 9, 13, 0.65);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  top: 8px;
  right: 8px;
  padding: 0;
}

.pop { width: 100%; display: flex; flex-direction: column; }
.pop-thumb { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--panel2); position: relative; }
.pop-thumb img, .pop-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.pop-cat-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(5px);
  color: var(--gold);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 9px;
  border-radius: 999px;
}
.pop-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; }
.pop-title { font-weight: 700; font-size: 15.5px; }
.pop-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pop-cap {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pop-uploader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted2);
}
.pop-user-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.pop-user-link:hover { color: var(--accent); }
.pop-actions { display: flex; gap: 8px; margin-top: 4px; }
.pop-actions .btn { flex: 1; }

.spot-here-pop { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.spot-here-pop b { font-size: 13.5px; }
.spot-here-pop .mono { font-size: 11.5px; color: var(--muted); }

.leaflet-control-attribution {
  background: var(--panel-glass) !important;
  color: var(--muted2) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--line2) !important;
}

/* --------------------------------------------------------------- views */
.view-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.view-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}
.view-sub { color: var(--muted2); font-size: 13px; margin-top: 2px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  cursor: pointer;
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }

.seg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.seg-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn:hover { color: var(--text); border-color: var(--line-accent); }
.seg-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 14px var(--accent-dim);
}

.icon-toggle {
  display: flex;
  border: 1px solid var(--line2);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.icon-toggle button {
  border: none;
  background: var(--panel);
  color: var(--muted2);
  padding: 7px 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-toggle button.active { color: var(--accent); background: var(--accent-dim); }
.icon-toggle svg { width: 16px; height: 16px; }

/* -------------------------------------------------------- catalog cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}
.catalog-list { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  box-shadow: var(--shadow-card);
}
.card:hover {
  border-color: var(--line-accent);
  transform: translateY(-3px);
}
.card-media {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--panel2);
  overflow: hidden;
}
.card-media img,
.card-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .card-media img { transform: scale(1.04); }

.card-cat {
  position: absolute;
  top: 9px;
  left: 9px;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--gold);
  padding: 3px 9px;
  border-radius: 999px;
}
.card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-weight: 700; font-size: 15.5px; letter-spacing: 0.2px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.card-chips .chip { font-size: 11px; padding: 3px 8px; }
.card-cap {
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted2);
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.card-user { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.card-user span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 115px; }
.card-foot .spacer { flex: 1; }

.heart {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 6px;
}
.heart svg { width: 15px; height: 15px; }
.heart.on, .heart:hover { color: var(--danger); }

.catalog-list .card { flex-direction: row; }
.catalog-list .card-media { width: 240px; flex: 0 0 auto; aspect-ratio: auto; min-height: 150px; }
.catalog-list .card-body { flex: 1; }

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel2);
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
  overflow: hidden;
  text-transform: uppercase;
}

/* -------------------------------------------------------- listing detail */
.listing-wrap { max-width: 1080px; margin: 0 auto; }
.listing-top-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.listing-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.gallery-shell { position: relative; }
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  border-radius: var(--radius);
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 16/9;
  background: #080a0f;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.gallery .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
.gallery .slide svg { width: 100%; height: 100%; }

.gal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
  display: grid;
  place-items: center;
}
.gal-arrow:hover { border-color: var(--accent); color: var(--accent); }
.gal-prev { left: 14px; }
.gal-next { right: 14px; }
.gal-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.gal-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted2);
  opacity: 0.45;
  transition: all 0.15s;
}
.gal-dots i.on { background: var(--accent); opacity: 1; transform: scale(1.3); }

.listing-title-row { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; flex-wrap: wrap; }
.listing-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vw, 25px);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.like-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.like-big svg { width: 17px; height: 17px; }
.like-big.on, .like-big:hover {
  color: var(--danger);
  border-color: rgba(255, 92, 124, 0.55);
  background: var(--danger-dim);
}
.listing-stats { color: var(--muted2); font-size: 13px; margin-bottom: 14px; }
.listing-cap { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
.listing-desc { color: var(--muted); font-size: 14px; max-width: 74ch; white-space: pre-wrap; margin: 0; }
.listing-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
}

.listing-cols {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.meta-cell { background: var(--panel); padding: 12px 14px; }
.meta-cell .label { margin-bottom: 4px; }
.meta-cell b { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; word-break: break-word; }

.mini-map {
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line2);
  position: relative;
}
.mini-map-actions { margin-top: 10px; display: flex; gap: 8px; }
.uploader-card {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  transition: border-color 0.15s;
}
.uploader-card:hover { border-color: var(--line-accent); }
.uploader-card .who { min-width: 0; }
.uploader-card .who b { display: block; font-size: 14.5px; }
.uploader-card .who span { font-size: 12px; color: var(--muted2); }
.uploader-card .go { margin-left: auto; color: var(--muted2); font-weight: 700; }

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 3200;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}
.lightbox-overlay img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
  object-fit: contain;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 18, 26, 0.8);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* --------------------------------------------------------------- profile */
.profile-head {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.avatar-big { position: relative; }
.avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #07090d;
  border: 3px solid var(--panel);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.profile-who { min-width: 220px; flex: 1; }
.profile-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.role-badge {
  font-size: 10px;
  letter-spacing: 1.4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 700;
}
.role-badge.member {
  border-color: var(--line2);
  background: var(--panel2);
  color: var(--muted);
}
.profile-handle { color: var(--muted2); font-size: 13px; }
.profile-bio { margin-top: 8px; font-size: 13.5px; color: var(--muted); max-width: 58ch; }
.pencil { background: none; border: none; color: var(--muted2); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.pencil:hover { color: var(--accent); }

.profile-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 18px;
  min-width: 118px;
}
.stat-card b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card span {
  font-size: 10.5px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 600;
}

.contact-panel {
  background: var(--panel);
  border: 1px dashed var(--line2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
}
.contact-panel .label { margin: 0 6px 0 0; display: inline; }
.contact-inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- admin */
.sys-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-s);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.sys-strip b { color: var(--text); font-family: var(--font-mono); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 26px;
}
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
}
.chart-card h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 400;
}
.chart-box { height: 210px; position: relative; }

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.admin-tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.admin-tab-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-toolbar .input { max-width: 280px; }
.admin-toolbar select.input { width: auto; min-width: 150px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  background: var(--panel);
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 680px; }
.tbl th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 11px 13px;
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
  background: var(--panel2);
}
.tbl td { padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(56, 232, 255, 0.03); }
.tbl .thumb-td { width: 66px; }
.tbl .thumb-td > div { width: 58px; height: 38px; border-radius: 6px; overflow: hidden; background: var(--panel2); }
.tbl .thumb-td img, .tbl .thumb-td svg { width: 100%; height: 100%; object-fit: cover; }
.tbl-actions { display: inline-flex; gap: 6px; align-items: center; }

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--muted);
}
.pagination-btns { display: flex; gap: 6px; align-items: center; }

/* empty state */
.empty {
  max-width: 460px;
  margin: 8vh auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty h2 {
  font-family: var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 16px;
  margin: 0;
}
.empty p { color: var(--muted); margin: 0 0 8px; }

/* --------------------------------------------------------------- modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(5, 6, 10, 0.74);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fadeIn 0.16s ease;
}
.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: var(--shadow-pop);
  animation: rise 0.2s ease;
}
.modal-wide { width: min(760px, 100%); }
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--muted);
  cursor: pointer;
  z-index: 5;
}
.modal-x:hover { color: var(--text); border-color: var(--accent); }
.modal h2 {
  font-family: var(--font-display);
  font-size: 14.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.modal .lead { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.tabs {
  display: flex;
  border: 1px solid var(--line2);
  border-radius: var(--radius-s);
  overflow: hidden;
  margin-bottom: 18px;
}
.tabs button {
  flex: 1;
  border: none;
  background: var(--panel2);
  color: var(--muted);
  padding: 10px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.tabs button.active { background: var(--accent-dim); color: var(--accent); }

/* wizard */
.wiz-steps { display: flex; gap: 6px; margin: 14px 0 20px; }
.wiz-steps span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted2);
  padding-top: 9px;
  position: relative;
}
.wiz-steps span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--line2);
}
.wiz-steps span.done::before { background: var(--accent); }
.wiz-steps span.now { color: var(--accent); font-weight: 700; }
.wiz-steps span.now::before { background: var(--accent); box-shadow: 0 0 10px var(--accent-dim); }
.wiz-foot { display: flex; gap: 10px; margin-top: 20px; }
.wiz-foot .spacer { flex: 1; }

.upload-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dropzone {
  border: 1.5px dashed var(--line2);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  color: var(--muted2);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
  display: block;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); color: var(--text); }
.dropzone input { display: none; }
.photo-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-thumbs .pt {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.photo-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumbs button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(7, 9, 13, 0.85);
  color: var(--danger);
  cursor: pointer;
  font-size: 11px;
}
.render-card { border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; background: #090b10; }
.render-card svg { width: 100%; height: auto; display: block; }
.render-note {
  font-size: 12px;
  color: var(--muted2);
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel2);
}
.render-wait {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  color: var(--muted2);
  font-size: 13px;
  text-align: center;
  padding: 18px;
}

.uw-map { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line2); position: relative; }
.uw-status { display: flex; align-items: center; gap: 9px; margin-top: 11px; font-size: 13px; color: var(--muted); min-height: 24px; flex-wrap: wrap; }
.uw-status b { color: var(--text); }
.uw-status svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.uw-coords { font-size: 11.5px; color: var(--muted2); font-family: var(--font-mono); }
.spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}
.review-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.review-list { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.review-list b { font-weight: 600; }
.review-list .label { display: inline; margin: 0 6px 0 0; }

.snapshot-preview-img {
  width: 100%;
  border-radius: var(--radius-s);
  border: 1px solid var(--line2);
  margin: 12px 0 16px;
  max-height: 52vh;
  object-fit: contain;
  background: #090b10;
}
.snapshot-info { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* user chip / menu */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.user-chip:hover { border-color: var(--line-accent); }
.user-chip-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#authArea { position: relative; }
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--radius-s);
  min-width: 192px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  padding: 6px;
  z-index: 1300;
}
.user-menu a,
.user-menu button {
  text-align: left;
  background: none;
  border: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.user-menu a:hover,
.user-menu button:hover { background: var(--panel2); }

/* --------------------------------------------------------------- toasts */
#toastRoot {
  position: fixed;
  z-index: 3500;
  bottom: calc(var(--bottomnav-h) + 18px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(94vw, 440px);
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  animation: rise 0.2s ease;
  max-width: 100%;
  text-align: center;
}
.toast.error { border-color: rgba(255, 92, 124, 0.55); color: var(--danger); }
.toast.ok { border-color: rgba(94, 234, 160, 0.5); color: var(--ok); }
.toast.live { border-color: var(--accent); color: var(--accent); }
.toast.out { opacity: 0; transition: opacity 0.3s; }

@media (min-width: 861px) {
  #toastRoot { bottom: 24px; }
}

@media (max-width: 1220px) {
  .region-jumper {
    top: 62px;
    left: 50%;
    max-width: calc(100vw - 400px);
  }
}

@media (max-width: 860px) {
  .map-hud { display: none; }
  .region-jumper {
    top: 96px;
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
  }
  .map-top-left { top: 10px; left: 10px; max-width: calc(100vw - 140px); }
  .map-top-right { top: 10px; right: 10px; }
  .fab-upload { display: none; }
  .fab-snapshot { bottom: 84px; right: 14px; }
  .fab-filter { bottom: 16px; }
  .catalog-grid { grid-template-columns: 1fr; gap: 13px; }
  .catalog-list .card { flex-direction: column; }
  .catalog-list .card-media { width: 100%; aspect-ratio: 16/10; }
  .upload-cols, .review-grid { grid-template-columns: 1fr; }
  .uw-map { height: 240px; }
  .mini-map { height: 195px; }
  .modal { padding: 20px 16px; border-radius: 16px; }
  .profile-head { padding: 16px; gap: 14px; }
  .gal-arrow { display: none; }
}
