* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html, body {
  width: 100%; height: 100%; height: 100dvh; overflow: hidden;
  background: #090d16; color: #f8fafc; display: flex; flex-direction: column;
}

.view-container { flex: 1 1 auto; min-height: 0; position: relative; display: none; flex-direction: column; overflow-y: auto; }
.view-container.active { display: flex; }

#map { width: 100%; height: 100%; z-index: 1; }
.leaflet-tile-pane { filter: brightness(0.88) contrast(1.06); }

.top-hud {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 10px;
  right: 10px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.hud-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: auto; }

.hud-pill {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid #374151;
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 8px #f43f5e; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { transform: scale(0.95); opacity: 1; } 70% { transform: scale(1.35); opacity: 0.4; } 100% { transform: scale(0.95); opacity: 1; } }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; pointer-events: auto; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  background: rgba(17, 24, 39, 0.94); border: 1px solid #374151; color: #e5e7eb;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; white-space: nowrap; cursor: pointer;
}
.chip.active { background: #3b82f6; border-color: #3b82f6; color: #fff; font-weight: 700; }
.chip.sub { padding: 4px 10px; font-size: 11px; background: rgba(15, 23, 42, 0.92); }
.chip.sub.active { background: #f59e0b; border-color: #f59e0b; color: #090d16; font-weight: 700; }

.center-crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%);
  z-index: 450; font-size: 28px; pointer-events: none; display: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.7));
}
.center-crosshair.visible { display: block; }

.fab-geo {
  position: absolute; bottom: 72px; right: 14px; z-index: 500;
  width: 44px; height: 44px; border-radius: 50%; background: #111827;
  border: 1px solid #374151; color: #f8fafc; font-size: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5); cursor: pointer;
}
.fab-add {
  position: absolute; bottom: 16px; right: 14px; z-index: 500;
  background: linear-gradient(135deg, #3b82f6, #f43f5e); color: #fff;
  border: none; border-radius: 28px; padding: 12px 18px; font-size: 14px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45); cursor: pointer;
}

.section-pad { padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 24px; }
.card {
  background: #111827; border: 1px solid #1f2937; border-radius: 14px;
  padding: 12px; margin-bottom: 10px;
}
.card.vip { border-color: #f59e0b; background: linear-gradient(180deg, rgba(245,158,11,0.08), #111827); }

.sheet {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 700;
  background: #111827; border-top: 1px solid #374151; border-radius: 18px 18px 0 0;
  padding: 16px; max-height: 85%; overflow-y: auto; display: none;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.75);
}
.sheet.open { display: block; }
.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.close-btn { background: #1f2937; color: #9ca3af; border: none; width: 28px; height: 28px; border-radius: 50%; font-size: 16px; cursor: pointer; }

label { display: block; font-size: 12px; color: #9ca3af; margin: 10px 0 4px; }
input[type="text"], input:not([type]), select, textarea {
  width: 100%; background: #090d16; border: 1px solid #374151; color: #f8fafc;
  padding: 10px; border-radius: 10px; font-size: 14px; outline: none;
}

.ttl-box { background: #090d16; border: 1px solid #374151; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.ttl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ttl-val { color: #f59e0b; font-weight: 700; font-size: 13px; }
input[type="range"] { width: 100%; accent-color: #3b82f6; cursor: pointer; height: 6px; }
.ttl-limits { display: flex; justify-content: space-between; font-size: 10px; color: #6b7280; margin-top: 4px; }
.fuzzy-hint { font-size: 11px; color: #f43f5e; margin-top: 6px; }

.btn {
  background: #3b82f6; color: #fff; border: none; padding: 11px 14px;
  border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 14px; width: 100%; margin-top: 10px;
}
.btn-vip { background: linear-gradient(135deg, #f59e0b, #d97706); color: #090d16; }
.btn-ghost { background: #1f2937; color: #e5e7eb; width: auto; margin-top: 0; padding: 8px 12px; font-size: 12px; }
.react-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

.msg-box { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; padding: 8px; background: #090d16; border-radius: 10px; }
.msg { padding: 8px 11px; border-radius: 12px; font-size: 13px; max-width: 85%; line-height: 1.35; }
.msg.mine { align-self: flex-end; background: #3b82f6; color: #fff; }
.msg.theirs { align-self: flex-start; background: #1f2937; color: #f3f4f6; }

.user-loc-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #3b82f6; border: 3px solid #ffffff;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.35), 0 2px 8px rgba(0,0,0,0.6);
}
.pick-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 650;
  background: #111827; border-top: 1px solid #374151; border-radius: 18px 18px 0 0;
  padding: 14px 16px; display: none; box-shadow: 0 -8px 24px rgba(0,0,0,0.65);
}
.pick-bar.open { display: block; }
.pick-actions { display: flex; gap: 8px; margin-top: 10px; }
.coords-pill {
  display: flex; justify-content: space-between; align-items: center;
  background: #090d16; border: 1px solid #374151; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 6px; font-size: 12px; color: #93c5fd;
}

nav.bottom-nav {
  flex: 0 0 auto; background: #111827; border-top: 1px solid #1f2937;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 1000;
}
.nav-item {
  background: none; border: none; color: #9ca3af; display: flex; flex-direction: column;
  align-items: center; gap: 3px; font-size: 10px; cursor: pointer; padding: 4px 2px; min-width: 0; white-space: nowrap;
}
.nav-item.active { color: #3b82f6; font-weight: 700; }
.nav-item span.ico { font-size: 18px; }
