html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; }
#map { height: 100%; }

.panel {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 12px;
}

.title { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.muted { color: #555; font-size: 13px; margin-bottom: 10px; line-height: 1.35; }

.row { display: flex; gap: 8px; }

input, textarea, button, select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  background: white;
}

textarea { resize: vertical; min-height: 64px; }

button { border: 0; cursor: pointer; background: #111; color: #fff; font-weight: 600; }
button.secondary { background: #f0f0f0; color: #111; border: 1px solid rgba(0,0,0,.12); }
button:disabled { opacity: .55; cursor: not-allowed; }

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f0f0f0;
  font-size: 12px;
  margin-top: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
  white-space: pre-wrap;
}
.msg.ok { background: #e9fff0; border: 1px solid #baffc9; color: #0b5a1a; }
.msg.err { background: #ffe9e9; border: 1px solid #ffbaba; color: #7a0000; }

.tabs { display:flex; gap:8px; margin-top: 8px; }
.tab {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.tab.active { background:#111; color:#fff; border-color:#111; }

.list { margin-top: 10px; max-height: 260px; overflow: auto; border-top: 1px solid rgba(0,0,0,.08); padding-top: 10px; }
.item { padding: 8px 10px; border: 1px solid rgba(0,0,0,.10); border-radius: 12px; background: #fff; margin-bottom: 8px; }
.item b { display:block; }
.item small { color:#666; display:block; margin-top:2px; }
.tinyrow { display:flex; gap:8px; margin-top:8px; }
.tinyrow button { padding:8px; border-radius:10px; font-size:13px; }

/* Modals */
.modalBackdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: none; align-items: center; justify-content: center; z-index: 2000;
  padding: 16px;
}
.modal {
  width: 440px; max-width: 100%;
  background: white; border-radius: 14px; padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.10);
}
.modal h3 { margin: 0 0 8px; font-size: 16px; }

/* ===== Layout positions ===== */

/* Top panel: tabs & lists */
.topPanel {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 420px;
  max-width: calc(100vw - 28px);
  z-index: 1100;
}

/* Floating control panel: login/refresh/logout */
.controlPanel {
  position: fixed;
  bottom: 16px;
  left: 16px;      /* change to right:16px for bottom-right */
  width: 300px;
  max-width: calc(100vw - 32px);
  z-index: 1100;
}

.controlPanel input,
.controlPanel button {
  margin-bottom: 8px;
}

@media (max-width: 700px) {
  .topPanel {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

@media (max-width: 600px) {
  .topPanel { width: calc(100vw - 24px); }
  .controlPanel { width: calc(100vw - 24px); left: 12px; bottom: 12px; }
}

/* Optional: ensure Leaflet zoom controls don't clash too much */
.leaflet-control-zoom {
  margin-top: 14px;
  margin-left: 14px;
}