html, body { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
#map { position: fixed; inset: 0; }
.maplibregl-ctrl-bottom-left { bottom: calc(76px + env(safe-area-inset-bottom)); }

button { min-height: 40px; }
.round {
  width: 46px; height: 46px; border-radius: 50%; padding: 0; font-size: 20px;
  background: rgba(17, 24, 32, .92); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.appbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 10;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(rgba(11, 16, 22, .9), rgba(11, 16, 22, 0));
  pointer-events: none;
}
.appbar > * { pointer-events: auto; }
.mission-btn {
  flex: 1; min-width: 0; justify-content: flex-start; height: 46px; border-radius: 23px; padding: 0 16px;
  background: rgba(17, 24, 32, .92); box-shadow: var(--shadow); font-weight: 700; font-size: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mission-btn span:first-child { overflow: hidden; text-overflow: ellipsis; }
.mission-btn .caret { color: var(--muted); margin-left: auto; }
.appbar .conn { width: 12px; height: 12px; }

.fabs { position: fixed; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 10; display: flex; flex-direction: column; gap: 10px; }
#locateBtn.on { color: #3b82f6; border-color: #3b82f6; }

.alertbar {
  position: fixed; z-index: 11; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 62px);
  background: #7f1d1d; color: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow);
  font-weight: 650; display: flex; gap: 10px; align-items: center;
}

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  display: grid; grid-template-columns: 1fr 1.3fr 1fr 1fr; gap: 6px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(11, 16, 22, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.actionbar button { flex-direction: column; gap: 0; padding: 6px 2px; height: 60px; border-radius: 12px; background: transparent; border-color: transparent; line-height: 1.1; }
.actionbar .i { font-size: 20px; }
.actionbar .t { font-size: 12px; font-weight: 650; }
.actionbar small { font-size: 10px; color: var(--muted); min-height: 12px; }
.actionbar .report { background: var(--danger); border-color: var(--danger); color: #fff; }
.actionbar .report .i { font-size: 24px; font-weight: 800; }
.actionbar .on { background: rgba(34, 197, 94, .15); border-color: rgba(34, 197, 94, .5); }
.actionbar .on small { color: #86efac; }
.actionbar .live { background: rgba(239, 68, 68, .2); border-color: var(--danger); }
.actionbar .live small { color: #fca5a5; }

.crosshair { position: fixed; left: 50%; top: 50%; width: 44px; height: 44px; margin: -44px 0 0 -22px; z-index: 9; pointer-events: none; }
.crosshair::before { content: "📍"; font-size: 40px; position: absolute; left: 2px; top: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.pickbar {
  position: fixed; z-index: 13; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 14px;
  display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow);
}
.pickbar span { flex: 1; color: var(--muted); font-size: 13px; }

/* ---------- bottom sheet ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .45); }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow: auto;
  background: var(--panel); border-top-left-radius: 18px; border-top-right-radius: 18px;
  border: 1px solid var(--line); box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-in .2s ease-out; -webkit-overflow-scrolling: touch;
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 10px; }
.sheet h2 { font-size: 19px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.sheet h2 .x { margin-left: auto; }
.sheet .kicker { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.sheet .section { margin-top: 16px; }
.sheet .section > h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.sheet input, .sheet textarea, .sheet select { font-size: 16px; padding: 11px 12px; }
.sheet .form { display: flex; flex-direction: column; gap: 14px; }
.sheet .big { width: 100%; padding: 14px; font-size: 16px; min-height: 52px; border-radius: 12px; }
.sheet .btnrow { display: flex; gap: 8px; }
.sheet .btnrow > * { flex: 1; min-height: 48px; border-radius: 12px; }

.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.types button {
  flex-direction: column; height: 92px; gap: 4px; border-radius: 14px; font-size: 12px; white-space: normal; line-height: 1.15;
  background: color-mix(in srgb, var(--c) 16%, var(--panel-2)); border-color: color-mix(in srgb, var(--c) 45%, var(--line));
}
.types button .e { font-size: 30px; }

.typehead { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c) 18%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); }
.typehead .e { font-size: 28px; }
.typehead b { font-size: 17px; flex: 1; }

.posrow { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.posrow .txt { flex: 1; font-size: 13px; }
.posrow .txt b { display: block; font-size: 14px; }

.seg.full { display: flex; }
.seg.full button { flex: 1; min-height: 40px; font-size: 14px; }

.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--panel-3); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; right: 2px; top: 2px; min-height: 0; width: 24px; height: 24px; padding: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); border: 0; font-size: 12px; }
.photobtns { display: flex; gap: 8px; }
.photobtns label { flex: 1; min-height: 48px; border-radius: 12px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.desc { white-space: pre-wrap; word-break: break-word; margin: 8px 0; }
.kv { display: grid; grid-template-columns: 105px 1fr; gap: 5px 10px; font-size: 14px; margin: 10px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.thumbs { grid-template-columns: repeat(3, 1fr); }

.listtabs { display: flex; gap: 6px; margin-bottom: 8px; }
.listtabs button { flex: 1; min-height: 38px; }
.listtabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.li .ic { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; border: 2px solid #fff; }
.li .tx { flex: 1; min-width: 0; }
.li .t1 { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li.dim { opacity: .55; }

.menu a, .menu button { display: flex; width: 100%; justify-content: flex-start; min-height: 50px; margin-bottom: 8px; border-radius: 12px; gap: 12px; }
.qrbox { background: #fff; border-radius: 12px; padding: 10px; width: 200px; margin: 6px auto; }
.qrbox svg { width: 100%; height: auto; display: block; }

.toasts { top: calc(env(safe-area-inset-top) + 62px); bottom: auto; left: 12px; right: 12px; max-width: none; }
#livePreview { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 16/9; object-fit: cover; }
