* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: #1f2937;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ---- Sidebar ---- */
#sidebar {
  width: 340px;
  min-width: 340px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  background: #fafafa;
}

.sidebar-header {
  padding: 16px 16px 8px;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 18px;
}

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.toolbar {
  padding: 8px 16px;
}

.search-box {
  display: flex;
  gap: 6px;
}

.search-box input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

.search-box button {
  padding: 0 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 13px;
  color: #374151;
  border-top: 1px solid #eee;
}

.link-danger {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 13px;
}
.link-danger:hover { text-decoration: underline; }

#list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  border-top: 1px solid #eee;
}

#list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  font-size: 13px;
}

#list li:hover { background: #f3f4f6; }

#list li .idx {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#list li .coords {
  flex: 1;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

#list li .del {
  border: none;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
#list li .del:hover { color: #dc2626; }

.export-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.export-row button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.export-row button:hover { background: #1d4ed8; }

/* ---- Map ---- */
#map {
  flex: 1;
  height: 100%;
}

/* ---- Error overlay ---- */
.map-error {
  position: fixed;
  inset: 0 0 0 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  text-align: center;
  padding: 24px;
}
.map-error p { color: #6b7280; font-size: 14px; line-height: 1.6; }
.map-error code {
  background: #eee;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s;
}

.hidden { display: none !important; }

/* map marker label bubble */
.marker-label {
  background: #2563eb;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}
