body { overflow: hidden; }
.auth { height: 100%; overflow: auto; max-width: 520px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.hero { text-align: center; padding-top: 12px; }
.hero img { border-radius: 18px; }

#app, #map { position: fixed; inset: 0; }
#map { z-index: 0; background: #e5e3df; }

.topbar { position: fixed; z-index: 500; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.pill { background: #fff; border-radius: 999px; box-shadow: var(--shadow); padding: 10px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pill.title { max-width: 45vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.mapbtns { position: fixed; z-index: 500; right: 10px; bottom: calc(var(--sheet-h, 170px) + 14px); display: flex; flex-direction: column; gap: 10px; }
.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 1.3em; cursor: pointer; }

.sheet { position: fixed; z-index: 600; left: 0; right: 0; bottom: 0; max-height: 45vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(16, 24, 40, .15); padding: 6px 12px calc(12px + env(safe-area-inset-bottom)); }
@media (min-width: 800px) { .sheet { left: 12px; right: auto; bottom: 12px; width: 360px; border-radius: 20px; max-height: 60vh; } .mapbtns { bottom: 24px; } }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: #d0d5dd; margin: 4px auto 8px; }
.empty { text-align: center; padding: 16px; color: var(--muted); }

.person { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.person:last-child { border-bottom: 0; }
.person .info { flex: 1; min-width: 0; }
.person .name { font-weight: 800; }
.person .meta { color: var(--muted); font-size: .85em; }
.person .right { text-align: right; font-size: .85em; color: var(--muted); }
.person .dist { font-weight: 800; color: var(--text); font-size: 1.1em; }
.person.sos { background: #fdecea; border-radius: 12px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75em; font-weight: 700; color: #fff; background: var(--muted); }
.badge.red { background: var(--red); } .badge.orange { background: var(--orange); } .badge.green { background: var(--green); }

.avatar { width: 42px; height: 42px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; background: #888; position: relative; }
.avatar.stale { filter: grayscale(1); opacity: .6; }

/* Map markers */
.mk { width: 40px; height: 40px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); display: grid; place-items: center; }
.mk span { transform: rotate(45deg); color: #fff; font-weight: 900; font-size: 15px; }
.mk.stale { filter: grayscale(1); opacity: .65; }
.mk.sos { animation: sosmk 1s infinite; background: var(--red); }
@keyframes sosmk { 50% { box-shadow: 0 0 0 14px rgba(217, 45, 32, .35); } }
.mk-label { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); background: #fff; padding: 1px 7px; border-radius: 8px; font-weight: 700; font-size: 12px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26, 115, 232, .25); }

.alertbar { position: fixed; z-index: 1500; left: 10px; right: 10px; top: calc(64px + env(safe-area-inset-top)); background: var(--red); color: #fff; border-radius: 14px; padding: 14px 16px; font-weight: 700; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.alertbar.orange { background: #b54708; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qr { width: 220px; height: 220px; display: block; margin: 0 auto; }
.linkbox { background: #f2f4f7; border-radius: 10px; padding: 10px; font-family: ui-monospace, monospace; font-size: .85em; word-break: break-all; }
.steps { padding-left: 20px; margin: 0; }
.steps li { margin: 6px 0; }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
