:root {
  --bg: #030303;
  --bg-grad: radial-gradient(circle at 50% -20%, #1e1b4b 0%, #030303 80%);
  --surface: rgba(20, 20, 23, 0.7);
  --surface-solid: #0d0d0f;
  --surface-2: #1c1c1f;
  --text: #ffffff;
  --muted: #94a3b8;
  --accent: #7c3aed;        /* Electric Violet */
  --accent-hover: #8b5cf6;
  --accent-blue: #0ea5e9;
  --accent-orange: #f59e0b;
  --accent-green: #10b981;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 16px 48px -12px rgba(0, 0, 0, 0.8);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --panel-width: 440px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body:not(.admin) { overflow: hidden; }

a { color: inherit; transition: all 0.2s ease; }

/* ===== Header ===== */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 32px;
  background: rgba(3, 3, 3, 0.65);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  position: relative;
  z-index: 1000;
}

/* ===== Provider Toggle (deprecated) ===== */
.provider-toggle, .provider-btn { display: none; }

.loc-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.loc-link-item {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}
.loc-link-item:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.bar h1 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.15));
}
.bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.social-link {
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  line-height: 1;
  transition: all 0.15s;
}
.social-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(-1px);
}

.status {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.status[data-kind="ok"] { color: var(--accent-green); }
.status[data-kind="pending"] { color: var(--accent-orange); }
.status[data-kind="err"] { color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
  background: #2d2d32;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}
.btn.danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}
.btn.danger:hover { background: #f87171; }

.btn.primary.map-preview-btn {
  background: #059669; /* Emerald Green */
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}
.btn.primary.map-preview-btn:hover {
  background: #10b981;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

#filter {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  min-width: 260px;
  font: inherit;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
#filter::placeholder { color: var(--muted); }
#filter:focus {
  outline: none;
  border-color: var(--accent);
  background: #1f2538;
}

/* ===== Tabs ===== */
.admin-filters {
  max-width: 980px;
  margin: 16px auto 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.8;
}

.rv-tab {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.rv-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.rv-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.panel-hint.warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-orange);
}

/* ===== Map + stage ===== */
.stage {
  display: flex;
  height: calc(100vh - var(--header-h));
  min-height: 0;
}
#map {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: #0e1118;
}

/* Leaflet control tweaks */
.leaflet-control-attribution {
  background: rgba(11, 13, 18, 0.55) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  backdrop-filter: blur(6px);
  border-radius: 6px 0 0 0 !important;
}
.leaflet-control-attribution a { color: #a5b3c9 !important; }

/* Custom markers */
.marker-primary {
  color: var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s;
}
.marker-primary:hover { transform: translateY(-2px); }
.marker-primary.active {
  color: var(--accent-orange);
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.45));
}

/* ===== Side panel ===== */
#panel {
  width: var(--panel-width);
  flex: 0 0 var(--panel-width);
  background: var(--surface);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  position: relative;
  padding: 18px 20px 32px;
}
#panel[hidden] { display: none; }

#panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  font-size: 18px;
  z-index: 2;
}

.panel-thumb-link {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s;
}
.panel-thumb-link:hover { transform: translateY(-2px); }
.panel-thumb {
  width: 100%;
  display: block;
  background: #222;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.panel-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.panel-title a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.2s;
}
.panel-title a:hover { background-size: 100% 1px; }

.panel-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.links-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}
.video-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.video-btn.bilibili {
  background: #fb7299; /* Bilibili Pink */
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.3);
}
.video-btn.bilibili:hover {
  background: #ff85ad;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 114, 153, 0.4);
}
.video-btn.youtube {
  background: #ff0000; /* YouTube Red */
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}
.video-btn.youtube:hover {
  background: #ff3333;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.panel-hint {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.panel-locs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.loc-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.loc-card:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}
.loc-card.active {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 8px 24px -8px rgba(124, 58, 237, 0.4);
}

.loc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.loc-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font: 600 12px/24px Inter, sans-serif;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.loc-place {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
}
.loc-comment {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text);
  opacity: 0.88;
  white-space: pre-wrap;
}
.loc-embed {
  display: block;
  width: 100%;
  height: 180px;
  border: 0;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #222;
}
.loc-preview-img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #222;
}
.preview-disclaimer {
  position: absolute;
  bottom: 12px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  text-align: center;
  backdrop-filter: blur(4px);
}
.loc-gmaps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-hover);
  text-decoration: none;
}
.loc-gmaps:hover { text-decoration: underline; }

/* ===== Admin ===== */
body.admin {
  overflow: auto;
  min-height: 100vh;
}
.admin .bar { position: sticky; top: 0; z-index: 20; }
.admin .hint {
  max-width: 980px;
  margin: 16px auto 0;
  padding: 12px 16px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}
.admin .hint:empty { display: none; }
.admin code {
  background: rgba(99, 102, 241, 0.12);
  color: #c7caff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

#list {
  max-width: 980px;
  margin: 18px auto 48px;
  padding: 0 16px;
  display: grid;
  gap: 14px;
}

.card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s ease;
}
.card:hover {
  border-color: var(--border-strong);
  background: rgba(28, 28, 31, 0.8);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-thumb img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  background: #000;
  aspect-ratio: 16/9;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.card-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; flex-direction: column; gap: 3px; }
.card-title {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.card-title:hover { color: var(--accent-hover); }
.card-meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.locations {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.locations li {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.locations li.muted {
  color: var(--muted);
  font-style: italic;
  border-style: dashed;
  background: transparent;
}
.locations li.is-contrib {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.08);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-new {
  background: var(--accent);
  color: #fff;
}
.badge-edit {
  background: var(--accent-orange);
  color: #1a1205;
}
.badge-remove {
  background: var(--danger);
  color: #fff;
}
.locations li.is-edited {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.06);
}
.locations li.is-removed {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.06);
  opacity: 0.75;
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, 0.6);
}
.locations li.is-removed .place,
.locations li.is-removed .url,
.locations li.is-removed .coords {
  text-decoration: inherit;
}

/* ===== Modal dialogs ===== */
.modal {
  border: none;
  padding: 0;
  width: min(480px, 94vw);
  max-width: 94vw;
  background: var(--surface-solid);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-strong);
}
.modal::backdrop {
  background: rgba(5, 7, 12, 0.55);
  backdrop-filter: blur(4px);
}
.modal form, .modal > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.modal input, .modal textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
  resize: vertical;
}
.modal input:focus, .modal textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #1f2538;
}
.modal .coord-hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: -6px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.modal p { margin: 0; font-size: 14px; line-height: 1.5; }
.modal p.subtle { color: var(--muted); font-size: 13px; }
.modal .summary {
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
body.contributor-mode .bar::before {
  content: "贡献者模式";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-hover);
  padding: 3px 7px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 4px;
  margin-right: 4px;
}
.loc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loc-row .place { flex: 1; font-weight: 500; font-size: 13px; }
.loc-row .coords {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}
.warn { color: var(--accent-orange); }

.icon-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 24px;
  line-height: 1;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.locations .url {
  display: block;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  margin-top: 4px;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.locations .url:hover { color: var(--accent-hover); }
.locations .comment {
  font-size: 12px;
  color: var(--text);
  margin-top: 6px;
  opacity: 0.85;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 8px;
  align-items: center;
}
.add-form input {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  min-width: 0;
  transition: all 0.2s ease;
}
.add-form input::placeholder { color: var(--muted); }
.add-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.05);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}
.add-form input[name=comment] { grid-column: 1 / 3; }
.add-form .coord-hint {
  grid-column: 3 / 4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}
.add-form button { grid-column: 3 / 4; }

.map-fullscreen {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + 10px);
  right: 10px;
  z-index: 900;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.map-fullscreen:hover { background: rgba(22, 26, 35, 0.92); }

/* ===== FAB Button ===== */
.fab-btn {
  position: fixed;
  right: 20px;
  bottom: 110px; /* Increased from 80px to avoid overlap */
  z-index: 1000;
  background: rgba(30, 30, 35, 0.85); /* Darker, cleaner semi-transparent */
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.fab-btn:hover {
  background: rgba(45, 45, 50, 0.95);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}
.fab-btn:active {
  transform: translateY(0);
}

.desktop-hint {
  max-width: 980px;
  margin: 12px auto 0;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  color: var(--accent-orange);
  font-size: 13px;
  font-weight: 500;
  display: none;
}
@media (max-width: 720px) {
  .desktop-hint { display: block; margin: 12px 16px 0; }
  .fab-btn { 
    right: 16px; 
    bottom: 24px; /* Adjust to stay clear of system bars but not too high */
    padding: 8px 14px;
    font-size: 12px;
    max-width: calc(100% - 32px); /* Prevent it from being wider than screen */
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 720px) {
  :root { --panel-width: 100%; --header-h: 52px; }
  
  .bar { padding: 0 12px; }
  .bar h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
  .bar-right .status { display: none; }

  /* Admin Mobile Optimization */
  .admin .bar {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 12px;
    position: static;
    margin-bottom: 8px;
  }
  .admin .bar h1 { max-width: none; }
  .admin .bar-right {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .admin #filter {
    width: 100%;
    min-width: 0;
    order: -1;
  }
  .admin .bar-right .btn {
    justify-content: center;
    padding: 10px;
  }
  
  .stage {
    flex-direction: column;
    height: calc(100vh - var(--header-h));
    min-height: 0;
    position: relative;
  }
  @supports (height: 100dvh) {
    .stage { height: calc(100dvh - var(--header-h)); }
  }
  
  #map {
    flex: 1 1 auto;
    height: 100%;
    position: relative;
    z-index: 1;
  }
  
  body.panel-open #map {
    flex: 0 0 25%;
    height: 25%;
  }
  
  #panel {
    width: 100%;
    flex: 1 1 75%;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    margin-top: -16px;
    z-index: 10;
    padding-top: 24px;
    padding-bottom: 120px; /* NEW: Extra padding so content can be scrolled above FAB */
    background: var(--surface-solid);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
  }
  
  #panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
  }
  
  #panel-close { top: 12px; right: 12px; }
  
  body.panel-open .map-fullscreen:not([hidden]) {
    display: inline-flex;
    align-items: center;
    position: absolute;
    top: calc(25% - 44px);
    bottom: auto;
    right: 10px;
    z-index: 900;
  }

  .card { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr; }
  .add-form input[name=comment],
  .add-form .coord-hint,
  .add-form button { grid-column: auto; }
}
