*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --glass-bg: rgba(14, 32, 54, 0.58);
  --glass-bg-strong: rgba(10, 24, 42, 0.72);
  --glass-bg-input: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-subtle: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(44px) saturate(170%);
  --glass-shadow:
    0 12px 40px rgba(0, 0, 0, 0.38),
    0 2px 8px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --glass-shadow-sm:
    0 4px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --accent: #5dd4f5;
  --accent-strong: #3ec4ea;
  --accent-soft: rgba(93, 212, 245, 0.16);
  --accent-glow: rgba(93, 212, 245, 0.35);
  --warn: #ffb340;
  --warn-soft: rgba(255, 179, 64, 0.14);
  --text-primary: rgba(255, 255, 255, 0.94);
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
  margin: 0;
  height: 100%;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  background: #061018;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#app.fs-fallback {
  position: fixed;
  inset: 0;
  z-index: 9999;
  height: 100vh;
  height: 100dvh;
}

/* ── Floating glass sidebar ── */
.sidebar {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.38s var(--ease-out), opacity 0.28s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  transform: translateX(calc(-100% - 28px));
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  position: relative;
  padding: 18px 16px 16px;
  padding-right: 52px;
  border-bottom: 1px solid var(--glass-border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
}

.sidebar-header-inner {
  text-align: center;
}

.sidebar-header h1 {
  margin: 12px 0 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.sidebar-brand-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  max-width: 100%;
}

.sidebar-brand-credit {
  margin: 8px 0 0;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.sidebar-brand-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.sidebar-brand-credit a:hover {
  color: var(--text-secondary);
  border-bottom-color: currentColor;
}

.sidebar-brand-cross {
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1;
  user-select: none;
}

.sidebar-brand-logo {
  width: auto;
  height: auto;
  object-fit: contain;
}

.sidebar-brand-logo--blzx {
  flex: 0 1 auto;
  max-width: min(34%, 72px);
  max-height: 36px;
}

.sidebar-brand-logo--sn2 {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(58%, 140px);
  max-height: 56px;
}

/* ── Glass buttons ── */
.sidebar-header button,
.sidebar-open,
.map-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.85rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.sidebar-header button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.sidebar-header button:hover,
.sidebar-open:hover,
.map-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--glass-border);
}

.map-ctrl-btn:active {
  transform: scale(0.94);
}

/* ── Search ── */
.sidebar-search {
  padding: 12px 14px 0;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-subtle);
  background: var(--glass-bg-input);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-search input::placeholder {
  color: var(--text-tertiary);
}

.sidebar-search input:focus {
  outline: none;
  border-color: rgba(93, 212, 245, 0.45);
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    0 0 0 3px var(--accent-soft);
}

/* ── Action buttons ── */
.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
}

.sidebar-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.sidebar-action-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-action-btn:hover {
  color: var(--text-primary);
  border-color: rgba(93, 212, 245, 0.35);
  background: var(--accent-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 16px rgba(93, 212, 245, 0.12);
}

.sidebar-action-btn:active {
  transform: scale(0.97);
}

/* ── Confirm dialog (glass) ── */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 18, 0.42);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.confirm-dialog[hidden] {
  display: none;
}

.confirm-dialog-panel {
  position: relative;
  width: min(100%, 340px);
  padding: 22px 22px 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

.confirm-dialog-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 179, 64, 0.75) 50%,
    transparent 100%
  );
}

.confirm-dialog-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(255, 179, 64, 0.1);
  border: 1px solid rgba(255, 179, 64, 0.22);
  color: var(--warn);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.confirm-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.confirm-dialog-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text-primary);
}

.confirm-dialog-title-tag {
  font-weight: 600;
  color: var(--warn);
}

.confirm-dialog-panel p {
  margin: 0 0 20px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-secondary);
  text-align: center;
}

.confirm-dialog-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: stretch;
}

.confirm-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-subtle);
  font-size: 0.86rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.confirm-btn:active {
  transform: scale(0.97);
}

.confirm-btn-secondary {
  color: var(--text-secondary);
}

.confirm-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

.confirm-btn-primary {
  color: #ffe8c4;
  border-color: rgba(255, 179, 64, 0.32);
  background: linear-gradient(
    145deg,
    rgba(255, 179, 64, 0.22) 0%,
    rgba(255, 140, 40, 0.14) 100%
  );
}

.confirm-btn-primary:hover {
  background: linear-gradient(
    145deg,
    rgba(255, 179, 64, 0.34) 0%,
    rgba(255, 140, 40, 0.22) 100%
  );
  border-color: rgba(255, 179, 64, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 18px rgba(255, 179, 64, 0.14);
}

.confirm-btn:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 3px var(--accent-soft);
}

.confirm-btn-primary:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 3px rgba(255, 179, 64, 0.2);
}

/* ── Category list ── */
.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.category-list::-webkit-scrollbar {
  width: 5px;
}

.category-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.category-group {
  margin-bottom: 6px;
}

.category-group-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 8px 4px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.category-group-toggle:hover {
  color: var(--text-secondary);
}

.category-group-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}

.category-group-toggle[aria-expanded="false"] .category-group-chevron {
  transform: rotate(-90deg);
}

.category-group-name {
  flex: 1;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.category-group-count {
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  opacity: 0.85;
}

.category-group-body {
  padding-bottom: 2px;
}

.category-group-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 10px 8px 4px;
}

.favorites-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px 4px;
}

.favorites-empty {
  margin: 4px 8px 8px;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-tertiary);
  text-align: center;
}

.favorite-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.favorite-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--glass-border-subtle);
}

.favorite-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.favorite-item .label {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-item-action {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.category-group--favorites .category-group-name {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.72rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--glass-border-subtle);
}

.category-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.12s ease;
}

.category-item input[type="checkbox"]:hover {
  border-color: rgba(93, 212, 245, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.category-item input[type="checkbox"]:checked {
  border-color: rgba(93, 212, 245, 0.55);
  background: linear-gradient(145deg, var(--accent-strong) 0%, var(--accent) 100%);
  box-shadow:
    0 0 12px rgba(93, 212, 245, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.category-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid rgba(255, 255, 255, 0.95);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.category-item input[type="checkbox"]:active {
  transform: scale(0.92);
}

.category-item input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.18),
    0 0 0 3px var(--accent-soft);
}

.category-item input[type="checkbox"]:checked:focus-visible {
  box-shadow:
    0 0 12px rgba(93, 212, 245, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 3px var(--accent-soft);
}

.category-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: auto;
}

.category-item .label {
  flex: 1;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.category-item .count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border-subtle);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(0, 0, 0, 0.12);
}

#marker-count {
  flex: 1;
  min-width: 0;
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-footer-btn {
  padding: 2px 0;
  border: none;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.sidebar-footer-btn:hover {
  color: var(--accent);
}

.about-dialog-panel::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(90, 200, 255, 0.65) 50%,
    transparent 100%
  );
}

.about-dialog-icon {
  background: rgba(90, 200, 255, 0.1);
  border-color: rgba(90, 200, 255, 0.22);
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.about-dialog-title-sub {
  font-weight: 600;
  color: var(--text-secondary);
}

.about-dialog-panel {
  width: min(100%, 400px);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
}

.about-dialog .confirm-dialog-head {
  flex-shrink: 0;
}

.about-dialog-body {
  margin-bottom: 18px;
  text-align: center;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 200, 255, 0.38) rgba(255, 255, 255, 0.05);
}

.about-dialog-body::-webkit-scrollbar {
  width: 6px;
}

.about-dialog-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
}

.about-dialog-body::-webkit-scrollbar-thumb {
  background: rgba(90, 200, 255, 0.35);
  border-radius: 99px;
}

.about-dialog-body p {
  margin: 0 0 10px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-secondary);
  text-align: center;
}

.about-dialog-body p:last-child {
  margin-bottom: 0;
}

.about-dialog-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.about-dialog-body a:hover {
  color: var(--text-primary);
  border-bottom-color: currentColor;
}

.about-dialog-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border-subtle);
  text-align: left;
}

.about-dialog-section-title {
  margin: 0 0 8px !important;
  font-size: 0.8rem !important;
  font-weight: 650 !important;
  color: var(--text-primary) !important;
  text-align: center !important;
}

.about-dialog-groups {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-tertiary);
}

.about-dialog-groups li {
  padding: 3px 0;
  word-break: break-word;
}

.about-dialog .confirm-dialog-actions {
  flex-shrink: 0;
}

.about-dialog .confirm-dialog-actions .confirm-btn {
  flex: 1;
}

/* ── Sidebar open + backdrop ── */
.sidebar-open {
  display: none;
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 1001;
  padding: 10px 14px;
  font-size: 1.1rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  box-shadow: var(--glass-shadow-sm);
}

.sidebar.collapsed ~ .sidebar-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sidebar-backdrop[hidden] {
  display: none;
}

/* ── Map ── */
#map-container {
  position: absolute;
  inset: 0;
  background: #061018;
}

.map-controls {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-sm);
}

.map-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-sm);
  user-select: none;
  box-shadow: none;
}

.map-ctrl-btn svg {
  display: block;
}

.map-ctrl-fs {
  position: relative;
}

.map-ctrl-fs svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  display: block;
}

.map-ctrl-fs .icon-fs-enter {
  display: block;
}

.map-ctrl-fs .icon-fs-exit {
  display: none;
}

.map-ctrl-fs.is-active .icon-fs-enter {
  display: none;
}

.map-ctrl-fs.is-active .icon-fs-exit {
  display: block;
}

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 16, 24, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.loading.hidden {
  display: none;
}

.leaflet-container {
  background: #061018;
  font-family: inherit;
}

.leaflet-pane.leaflet-map-pane,
.leaflet-pane.leaflet-overlay-pane,
.leaflet-pane.leaflet-marker-pane {
  will-change: transform;
}

.sn2-map-image {
  pointer-events: none;
  image-rendering: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.sn2-popup.leaflet-popup,
.sn2-popup .leaflet-popup-content-wrapper,
.sn2-popup .leaflet-popup-content,
.sn2-popup .popup-content,
.sn2-popup .popup-content .desc {
  user-select: text;
  -webkit-user-select: text;
}

.sn2-marker {
  background: transparent;
  border: none;
}

.sn2-marker img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.18s var(--ease-out);
}

.sn2-marker:hover img {
  transform: scale(1.15);
}

.sn2-marker-emoji .emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.18s var(--ease-out);
}

.sn2-marker-emoji:hover .emoji {
  transform: scale(1.15);
}

.sn2-marker-labeled {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.sn2-marker-label-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 2.7em;
  min-height: 1.35em;
}

.sn2-marker-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-width: 100%;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  color: #f4f8fb;
  text-align: center;
  overflow: hidden;
  word-break: break-all;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 4px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.sn2-marker-labeled .sn2-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sn2-marker-labeled .sn2-marker-icon img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.18s var(--ease-out);
}

.sn2-marker-labeled:hover .sn2-marker-icon img {
  transform: scale(1.15);
}

.sn2-marker-labeled .sn2-marker-icon.sn2-marker-emoji .emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.18s var(--ease-out);
}

.sn2-marker-labeled:hover .sn2-marker-icon.sn2-marker-emoji .emoji {
  transform: scale(1.15);
}

.category-item .cat-emoji {
  width: 22px;
  text-align: center;
  font-size: 16px;
  line-height: 22px;
  flex-shrink: 0;
}

.sn2-marker-dot .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.sn2-marker-dot:hover .dot {
  transform: scale(1.2);
  background: var(--accent);
}

/* ── Glass popup ── */
.sn2-popup .leaflet-popup-content-wrapper {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 2px;
}

.sn2-popup .leaflet-popup-content {
  margin: 12px 14px;
}

.sn2-popup .leaflet-popup-tip-container {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.sn2-popup .leaflet-popup-tip {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

.popup-content h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.popup-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.popup-head-text {
  flex: 1;
  min-width: 0;
}

.popup-head-text h3 {
  margin: 0 0 4px;
}

.popup-head-text .subtitle {
  margin: 0;
}

.popup-head-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 72px;
}

.popup-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.popup-locate-btn:hover {
  background: rgba(93, 212, 245, 0.12);
  border-color: rgba(93, 212, 245, 0.4);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(93, 212, 245, 0.12);
}

.popup-fav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 200, 80, 0.35);
  color: var(--text-primary);
}

.popup-fav-btn.is-favorited {
  border-color: rgba(255, 200, 80, 0.45);
  background: rgba(255, 200, 80, 0.12);
  color: #ffd98a;
  box-shadow: 0 0 10px rgba(255, 200, 80, 0.12);
}

.popup-content .subtitle {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.popup-content dl {
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 0.84rem;
}

.popup-content dt {
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.78rem;
}

.popup-content dd {
  margin: 0;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.popup-content .desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  padding-right: 6px;
  margin-right: -2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 200, 255, 0.38) rgba(255, 255, 255, 0.05);
}

.popup-content .desc::-webkit-scrollbar {
  width: 6px;
}

.popup-content .desc::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  margin: 2px 0;
}

.popup-content .desc::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(90, 200, 255, 0.5) 0%,
    rgba(90, 200, 255, 0.28) 100%
  );
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 28px;
}

.popup-content .desc::-webkit-scrollbar-thumb:hover {
  background: rgba(90, 200, 255, 0.55);
}

.popup-content .desc::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.popup-content .desc::-webkit-scrollbar-corner {
  background: transparent;
}

.popup-content .sources {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 320px);
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    opacity: 1;
    pointer-events: none;
  }

  .sidebar-header {
    padding: 16px 16px 14px;
    padding-right: 56px;
  }

  .sidebar-header button {
    top: 16px;
    right: 16px;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .sidebar-search input {
    font-size: 16px;
    padding: 11px 14px;
  }

  .sidebar-action-btn {
    min-height: 42px;
    font-size: 0.88rem;
  }

  .category-item {
    padding: 10px;
    min-height: 44px;
  }

  .category-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 7px;
  }

  .category-item input[type="checkbox"]:checked::after {
    left: 6.5px;
    top: 2.5px;
    width: 5px;
    height: 9px;
  }

  .category-item .label {
    font-size: 0.9rem;
  }

  .sn2-marker img {
    width: 24px;
    height: 24px;
  }

  .sn2-marker-label {
    font-size: 9px;
    line-height: 1.35;
  }

  .sn2-marker-labeled .sn2-marker-icon img {
    width: 24px;
    height: 24px;
  }

  .sn2-marker-emoji .emoji {
    width: 22px !important;
    height: 22px !important;
    font-size: 16px !important;
  }

  .sn2-popup .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 48px);
  }

  .popup-content .desc {
    max-height: 120px;
  }

  .map-controls {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .map-ctrl-btn {
    width: 44px;
    height: 44px;
    font-size: 1.45rem;
  }
}

@media (max-width: 480px) {
  .sidebar-header h1 {
    font-size: 0.98rem;
  }

  .sidebar-open {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-action-btn,
  .map-ctrl-btn,
  .confirm-btn,
  .sn2-marker img,
  .sn2-marker-emoji .emoji {
    transition: none;
  }
}
