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

body, html {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

#panel {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 320px;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#panel h2 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

#panel hr {
  border: 0;
  height: 1px;
  background: #e0e0e0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-group label,
.source-config label {
  font-size: 12px;
  font-weight: 600;
  color: #444;
}

select,
input[type="text"],
input[type="url"],
input[type="datetime-local"] {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
}

.custom-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.radio-row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  margin-top: 2px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}

.primary-btn {
  background: #1e88e5;
  color: #fff;
  margin-top: 4px;
}
.primary-btn:hover {
  background: #1565c0;
}

.secondary-btn {
  background: #f1f3f4;
  color: #333;
  margin-top: 2px;
}
.secondary-btn:hover {
  background: #e0e2e5;
}

#status-indicator {
  font-size: 11px;
  color: #666;
  font-style: italic;
  min-height: 16px;
}

.legend {
  font-size: 12px;
}
.legend h3 {
  font-size: 13px;
  margin-bottom: 6px;
  color: #333;
}
.legend-section {
  margin-bottom: 8px;
}
.legend-section b {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  color: #333;
}
.swatch {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
}
.swatch.fill {
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Suggestion Mode Banner & Controls */
.suggestion-banner {
  background: linear-gradient(135deg, #7b1fa2, #9c27b0);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(156, 39, 176, 0.35);
}

.suggestion-banner .banner-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.suggestion-banner .banner-subtitle {
  font-size: 10px;
  opacity: 0.9;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  margin-top: 2px;
}

.checkbox-row input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
}

/* Interactive OSM Tag Suggestion Popup */
.maplibregl-popup {
  z-index: 20;
}

.suggestion-popup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #222;
  min-width: 280px;
  max-width: 420px;
  max-height: 400px;
  overflow-y: auto;
}

.suggestion-popup-header {
  border-bottom: 2px solid #9c27b0;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.suggestion-popup-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: #111;
}

.suggestion-meta {
  font-size: 11px;
  color: #666;
  display: flex;
  gap: 8px;
  align-items: center;
}

.suggestion-set-card {
  background: #f9f9fb;
  border: 1px solid #e2e4e8;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  position: relative;
}

.suggestion-set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.prominence-badge {
  background: #9c27b0;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.prominence-badge.segment-badge {
  background: #7b1fa2;
}

.spaces-count {
  font-size: 11px;
  font-weight: 600;
  color: #444;
}

.tag-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.tag-table td {
  padding: 3px 4px;
  border: 1px solid #e0e0e0;
  vertical-align: top;
  word-break: break-all;
}

.tag-key {
  font-weight: 600;
  color: #0d47a1;
  background: #f0f4f8;
  width: 45%;
}

.tag-val {
  color: #2e7d32;
  background: #fff;
}

.btn-copy-tags {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-copy-tags:hover {
  background: #9c27b0;
  color: #fff;
  border-color: #9c27b0;
}

.btn-copy-tags.copied {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

.sign-description {
  font-size: 10px;
  color: #666;
  font-style: italic;
  margin-top: 4px;
}