* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #app {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.toolbar h1 { font-size: 1.25rem; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn {
  padding: 0.45rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all .2s ease;
}
.btn:hover { background: #f9fafb; }
.btn.primary { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.btn.primary:hover { background: #0284c7; }
.btn.danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn.danger:hover { background: #dc2626; }
.btn.active { outline: 2px solid #0ea5e9; outline-offset: 2px; }

.mode-hint {
  width: 100%;
  font-size: 0.85rem;
  color: #6b7280;
  min-height: 1.2rem;
}

.map-wrap {
  display: flex;
  height: calc(100% - 64px);
}

#map { flex: 1; }

.sidebar {
  width: 320px;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar h2 { font-size: 1rem; margin-bottom: 0.5rem; color: #374151; }

.spot-list { list-style: none; }
.spot-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  margin-bottom: 0.4rem;
  background: #f9fafb;
}
.spot-list li .name { font-weight: 500; }
.spot-list li .meta { font-size: 0.75rem; color: #6b7280; }
.spot-list li button {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
}

.route-info { font-size: 0.9rem; color: #374151; line-height: 1.5; }
.route-info .stat { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px dashed #e5e7eb; }
.route-info .stat:last-child { border-bottom: none; }

.leaflet-popup-content-wrapper { border-radius: 0.5rem; }
.leaflet-popup-content { margin: 0.75rem 1rem; }

@media (max-width: 768px) {
  .map-wrap { flex-direction: column-reverse; }
  .sidebar { width: 100%; height: 35%; border-left: none; border-top: 1px solid #e5e7eb; }
  #map { height: 65%; }
}
