html, body, #map {
  margin: 0;
  width: 100%;
  height: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fb;
}
.topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,.94);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
}
.avatar-wrap {
  width: 42px;
  height: 42px;
  position: relative;
  flex: 0 0 42px;
}
.avatar-wrap img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  background: #ebebeb;
}
.avatar-wrap input {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.avatar-marker {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 3px solid #fff;
  object-fit: cover;
  background: #e3e3e3;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.name-btn {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  text-align: left;
}
.online-count {
  font-size: 12px;
  font-weight: 700;
  color: #2e7d32;
}
.menu-btn {
  border: 1px solid #ddd;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  background: #fff;
}
.user-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 66px);
  right: 12px;
  width: 248px;
  max-height: 55vh;
  overflow: auto;
  z-index: 1000;
  background: rgba(255,255,255,.96);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
}
.user-panel.hidden {
  display: none;
}
.panel-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
}
.user-row:active {
  background: #efefef;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: #ddd;
}
.user-avatar.offline {
  filter: grayscale(1);
  opacity: 0.6;
}
.user-meta {
  display: flex;
  flex-direction: column;
}
.user-main {
  font-size: 13px;
  color: #222;
}
.user-time {
  font-size: 11px;
  color: #666;
}
.right-tools {
  position: fixed;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fab {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 15px rgba(0,0,0,.2);
  font-size: 18px;
}
.bottom-card {
  position: fixed;
  left: 12px;
  right: 66px;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  z-index: 1000;
  background: rgba(255,255,255,.95);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,.15);
}
#selectedText {
  font-weight: 700;
  font-size: 14px;
}
#extraText {
  color: #666;
  font-size: 12px;
  margin-top: 4px;
}
.place-image {
  margin-top: 8px;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
}
.place-image.hidden,
.hidden {
  display: none;
}
.danger-btn {
  margin-top: 8px;
  border: 1px solid #ff6b6b;
  color: #d32f2f;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}
.modal-title {
  font-weight: 700;
  margin-bottom: 10px;
}
.text-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
}
.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  padding: 6px 12px;
}
.btn.primary {
  border-color: #1e88e5;
  color: #1e88e5;
}

.image-preview-wrap {
  width: min(92vw, 900px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#imagePreview {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  object-fit: contain;
}
