:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { min-height: 46px; border: 0; border-radius: 10px; padding: 0 16px; font-weight: 700; cursor: pointer; background: #e5e7eb; color: #111827; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { background: #166534; color: white; }
button.danger { background: #b91c1c; color: white; }
button.secondary { background: #e5e7eb; }
.screen { width: 100%; height: 100%; }
.hidden { display: none !important; }
.welcome-screen, #join { display: grid; place-items: center; padding: 20px; overflow: auto; }
.card { background: white; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 22px; }
.intro-card, .join-card { width: min(460px, 100%); }
h1, h2 { margin: 0 0 12px; }
p { line-height: 1.55; }
label { display: grid; gap: 6px; margin: 14px 0; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: white; color: #111827; }
textarea { resize: vertical; }
.intro-card button, .join-card button, .modal-card button { width: 100%; margin-top: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: #6b7280; margin: 18px 0 8px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #d1d5db; }
.error { color: #b91c1c; min-height: 1.2em; }
.muted { color: #6b7280; font-size: .9rem; }
.main-screen { position: relative; background: #e5e7eb; }
.topbar { position: absolute; z-index: 1000; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); padding: 10px 12px; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.16); }
.session-title { font-weight: 800; }
.session-meta { font-size: .78rem; color: #4b5563; margin-top: 2px; }
.badge { border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 800; background: #e5e7eb; white-space: nowrap; }
.badge.online { background: #dcfce7; color: #166534; }
.badge.offline { background: #fee2e2; color: #991b1b; }
#map { position: absolute; inset: 0; }
.floating-status { position: absolute; z-index: 900; left: 10px; bottom: 78px; display: flex; gap: 8px; flex-wrap: wrap; }
.floating-status > div { background: rgba(255,255,255,.94); border-radius: 999px; padding: 7px 10px; box-shadow: 0 2px 10px rgba(0,0,0,.14); font-size: .82rem; font-weight: 700; }
.actions { position: absolute; z-index: 1000; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.actions button { box-shadow: 0 4px 14px rgba(0,0,0,.22); padding: 0 10px; }
.modal { position: absolute; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.42); }
.modal-card { width: min(460px, 100%); max-height: 90vh; overflow: auto; }
.map-marker { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,.35); color: white; font-size: 16px; font-weight: 900; }
.map-marker.ground { background: #166534; }
.map-marker.drone { background: #1d4ed8; }
.map-marker.vehicle { background: #7c3aed; }
.map-marker.hq { background: #374151; }
.finding-marker { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #b91c1c; border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.finding-marker > span { display: block; transform: rotate(45deg); color: white; text-align: center; line-height: 24px; font-size: 14px; }
.leaflet-control-attribution { font-size: 9px; }
@media (max-width: 560px) {
  .topbar { top: max(8px, env(safe-area-inset-top)); }
  .actions { grid-template-columns: 1.25fr .85fr .95fr; }
  .actions button { font-size: .86rem; }
}
