:root {
  --bg: #0a0e1a;
  --bg-2: #0f172a;
  --bg-3: #111827;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e5e7eb;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --teal: #14b8a6;
  --teal-bright: #2dd4bf;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}

#app { height: 100%; width: 100%; position: relative; }

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: all 200ms var(--ease);
}

button:disabled { opacity: 0.4; cursor: not-allowed; }

a { color: var(--teal-bright); }

/* ============================================================
   LOGIN
   ============================================================ */

.login {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(20, 184, 166, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(139, 92, 246, 0.15), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.login-card {
  width: min(420px, 100%);
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.35);
}

.login-logo svg { width: 28px; height: 28px; color: #0a0e1a; }

.login h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login .tagline {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 2px;
}

.login h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all 200ms var(--ease);
}

.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 14px 18px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
  color: #0a0e1a;
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(20, 184, 166, 0.35); }
.btn-primary:active { transform: translateY(0); }

.login-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  color: #fda4af;
  font-size: 13px;
}

.login-hint {
  margin-top: 24px;
  padding: 14px;
  background: rgba(20, 184, 166, 0.06);
  border: 1px dashed rgba(20, 184, 166, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}

.login-hint strong { color: var(--teal-bright); font-weight: 600; }

/* ============================================================
   APP SHELL (admin + traveler)
   ============================================================ */

.shell { position: absolute; inset: 0; display: flex; flex-direction: column; }

.map { flex: 1; width: 100%; background: var(--bg-2); }
.leaflet-container { background: var(--bg-2); font-family: inherit; }

.topbar {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  right: 12px;
  z-index: 700;
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.brand-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 10px var(--teal-bright);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.group-chip {
  flex: 1;
  padding: 10px 14px;
  background: rgba(10, 14, 26, 0.75);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: default;
}

.group-chip.switcher {
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.group-chip.switcher:hover { border-color: var(--border-strong); background: rgba(10, 14, 26, 0.85); }

.group-chip .gc-text {
  flex: 1;
  min-width: 0;
}

.group-chip .gc-caret {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.group-chip .group-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-chip .group-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Group switcher popover */
.group-popover {
  position: fixed;
  z-index: 800;
  max-width: calc(100vw - 24px);
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  padding: 10px;
  animation: modal-in 180ms var(--ease);
}

.gp-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 6px 10px 8px;
}

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

.gp-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 140ms var(--ease);
}

.gp-list li:hover { background: rgba(255, 255, 255, 0.05); }
.gp-list li.active { background: rgba(20, 184, 166, 0.12); }

.gp-info { flex: 1; min-width: 0; }

.gp-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 10px var(--teal-bright);
}

.gp-new {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 11px;
  border-top: 1px solid var(--border);
  border-radius: 10px;
  color: var(--teal-bright);
  font-weight: 600;
  font-size: 13px;
  transition: background 140ms var(--ease);
}

.gp-new:hover { background: rgba(20, 184, 166, 0.12); }
.gp-new svg { width: 16px; height: 16px; }

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.icon-btn svg { width: 18px; height: 18px; color: var(--text); }
.icon-btn:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.05); }

.icon-btn.primary {
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(20, 184, 166, 0.4);
}
.icon-btn.primary svg { color: #0a0e1a; }
.icon-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.5);
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
}

/* ============================================================
   MODAL — new trip, etc.
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(5, 8, 15, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 200ms var(--ease);
  padding-top: max(env(safe-area-inset-top, 0), 20px);
  padding-bottom: max(env(safe-area-inset-bottom, 0), 20px);
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 260ms var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  padding: 22px 24px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-head .close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--text-dim);
  border-radius: 50%;
}
.modal-head .close:hover { background: var(--surface); color: var(--text); }
.modal-head .close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 12px 24px 24px;
}

.modal-body .field { margin-bottom: 18px; }

.modal-body .field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-body .field label .hint {
  font-size: 14px;
  color: var(--teal-bright);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.modal-body input[type="text"],
.modal-body input:not([type]),
.modal-body input[type="number"],
.modal-body select {
  width: 100%;
  padding: 13px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.modal-body input:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.modal-body select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
}

/* Range slider */
.modal-body input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  outline: none;
  padding: 0;
  margin: 6px 0;
}
.modal-body input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
  border: 3px solid #0a0e1a;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.5);
}
.modal-body input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-bright);
  border: 3px solid #0a0e1a;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-secondary {
  flex: 1;
  padding: 13px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 160ms var(--ease);
}
.btn-secondary:hover { background: var(--surface-strong); }

.modal-actions .btn-primary { flex: 1.3; margin-top: 0; }

.modal-success {
  padding: 0 24px 24px;
  text-align: left;
}

.success-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--teal-bright);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.success-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.5;
}

.cred-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
}

.cred-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.cred-list li:last-child { border-bottom: none; }

.cred-user {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  color: var(--teal-bright);
  font-weight: 600;
}

.cred-name {
  color: var(--text-dim);
}

.modal-success .btn-primary {
  width: 100%;
  margin-top: 0;
}

/* ============================================================
   ADMIN — right panel (roster + alerts)
   ============================================================ */

.side-panel {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: min(360px, 100%);
  z-index: 600;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(0);
  transition: transform 280ms var(--ease);
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.side-panel.hidden { transform: translateX(100%); pointer-events: none; }

.side-head {
  padding: 72px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.side-head h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.side-head .close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-dim);
}

.side-head .close:hover { background: var(--surface); color: var(--text); }

.alerts-block {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.alerts-block .title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rose);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}

.alerts-block .title::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 10px var(--rose);
  animation: pulse-dot 1.4s infinite;
}

.alert-card {
  padding: 12px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 200ms var(--ease);
}

.alert-card:hover { background: rgba(244, 63, 94, 0.18); transform: translateX(-2px); }
.alert-card .a-name { font-weight: 700; font-size: 14px; }
.alert-card .a-meta { color: #fecdd3; font-size: 12px; margin-top: 2px; }

.roster-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 20px;
}

.roster-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 10px 6px;
}

.roster-head .count {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.roster-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 160ms var(--ease);
}

.roster-item:hover { background: var(--surface); }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #0a0e1a;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  position: relative;
}

.avatar .halo {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: pulse-halo 2s infinite;
}

.roster-item.live .avatar .halo { opacity: 1; }

@keyframes pulse-halo {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

.roster-item .who { flex: 1; min-width: 0; }
.roster-item .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-item .sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status.live { background: rgba(20, 184, 166, 0.15); color: var(--teal-bright); }
.status.stale { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.status.offline { background: rgba(100, 116, 139, 0.2); color: var(--text-dim); }
.status.alert { background: rgba(244, 63, 94, 0.2); color: var(--rose); }

.side-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}

.side-foot .threshold {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
}

.side-foot .threshold input {
  width: 58px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}

.side-foot .threshold input::-webkit-outer-spin-button,
.side-foot .threshold input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.side-foot .threshold input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.logout-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.logout-btn:hover { color: var(--rose); border-color: rgba(244, 63, 94, 0.4); }

/* ============================================================
   TRAVELER — bottom glass card
   ============================================================ */

.bottom-sheet {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 500;
  padding: 18px;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.bs-row {
  display: flex; align-items: center; gap: 14px;
}

.bs-pulse {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(20, 184, 166, 0.15);
  display: grid; place-items: center;
  position: relative;
  flex-shrink: 0;
}

.bs-pulse::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--teal-bright);
  animation: pulse-halo 2s infinite;
}

.bs-pulse svg { width: 20px; height: 20px; color: var(--teal-bright); }

.bs-pulse.stale { background: rgba(245, 158, 11, 0.15); }
.bs-pulse.stale::after { border-color: var(--amber); }
.bs-pulse.stale svg { color: var(--amber); }

.bs-text { flex: 1; }
.bs-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal-bright); }
.bs-status.stale { color: var(--amber); }
.bs-main { font-size: 15px; font-weight: 700; margin-top: 2px; }
.bs-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.bs-actions {
  margin-top: 14px;
  display: flex; gap: 8px;
}

.bs-actions button {
  flex: 1;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.bs-actions button:hover { background: var(--surface-strong); }
.bs-actions button.danger { color: var(--rose); }
.bs-actions button.danger:hover { border-color: rgba(244, 63, 94, 0.4); }

/* Traveler peer list (small chips above the sheet) */
.peers {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
  z-index: 450;
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.peers::-webkit-scrollbar { display: none; }

.peer-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 6px;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
  font-size: 12px;
}

.peer-chip .avatar { width: 22px; height: 22px; font-size: 10px; }
.peer-chip .avatar .halo { display: none; }

/* ============================================================
   MAP MARKERS
   ============================================================ */

.pin {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #0a0e1a;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  border: 3px solid #0a0e1a;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  position: relative;
}

.pin.live::before {
  content: '';
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.6;
  animation: pulse-pin 2s infinite;
}

.pin.alert::before {
  content: '';
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--rose);
  animation: pulse-pin 1.2s infinite;
}

@keyframes pulse-pin {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.pin.self {
  background: var(--teal-bright) !important;
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.25), 0 4px 14px rgba(0,0,0,0.5);
}

/* ============================================================
   TOAST
   ============================================================ */

.toast-stack {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 78px);
  right: 12px;
  z-index: 700;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  animation: slide-in 260ms var(--ease);
  max-width: 320px;
}

.toast.ok {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.4);
  color: var(--teal-bright);
}

@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   MEDIA
   ============================================================ */

@media (max-width: 640px) {
  .side-panel { width: 100%; }
}

.hidden { display: none !important; }

/* Leaflet popup look */
.leaflet-popup-content-wrapper {
  background: rgba(10, 14, 26, 0.95);
  color: var(--text);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.leaflet-popup-tip { background: rgba(10, 14, 26, 0.95); }
.leaflet-popup-content { font-family: inherit; margin: 10px 14px; font-size: 13px; }
.leaflet-control-attribution {
  background: transparent !important;
  color: rgba(100, 116, 139, 0.5) !important;
  font-size: 10px !important;
  padding: 2px 8px !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
}
.leaflet-control-attribution a { color: rgba(100, 116, 139, 0.6) !important; }

/* Zoom control — glassmorphism pill matching the rest of the UI */
.leaflet-bar {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.leaflet-control-zoom.leaflet-bar {
  border-radius: 999px !important;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  background: rgba(10, 14, 26, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  margin: 14px !important;
}

.leaflet-control-zoom a {
  background: transparent !important;
  color: var(--text) !important;
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  border: none !important;
  border-radius: 0 !important;
  transition: all 180ms var(--ease);
  text-decoration: none !important;
}

.leaflet-control-zoom a.leaflet-control-zoom-in {
  border-top-left-radius: 999px !important;
  border-top-right-radius: 999px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-zoom a.leaflet-control-zoom-out {
  border-bottom-left-radius: 999px !important;
  border-bottom-right-radius: 999px !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(20, 184, 166, 0.18) !important;
  color: var(--teal-bright) !important;
}

.leaflet-control-zoom a.leaflet-disabled {
  color: var(--text-faint) !important;
  background: transparent !important;
}

/* Push the top-left zoom control below the floating topbar */
.leaflet-top.leaflet-left {
  top: calc(env(safe-area-inset-top, 0px) + 66px) !important;
}

/* Mobile: drop the zoom control entirely — pinch-to-zoom is the native pattern
   and the control otherwise collides with the side-panel. */
@media (max-width: 640px) {
  .leaflet-control-zoom { display: none !important; }
}
