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

body {
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #0d1117;
  color: #c9d1d9;
}

/* --- Left Pane (40%) --- */

#left-pane {
  width: 40%;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #30363d;
  overflow: hidden;
}

#form-section {
  padding: 12px;
  border-bottom: 1px solid #30363d;
  background: #161b22;
}

#meta-section {
  padding: 8px 12px;
  border-bottom: 1px solid #30363d;
  background: #161b22;
  font-size: 13px;
}

#xml-section {
  flex: 1;
  overflow: auto;
  background: #0d1117;
  padding: 12px;
}

#xml-section pre {
  margin: 0;
  white-space: pre;
  font-size: 12px;
  line-height: 1.6;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

#xml-section code {
  font-family: inherit;
}

/* --- Right Pane (60%) --- */

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

/* --- Form --- */

#enrich-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#file-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#gpx-file {
  flex: 1;
  font-size: 13px;
  color: #c9d1d9;
}

#gpx-file::file-selector-button {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}

#gpx-file::file-selector-button:hover {
  background: #30363d;
}

#submit-btn {
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#submit-btn:hover:not(:disabled) {
  background: #6d28d9;
}

#submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

#config-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #8b949e;
}

#config-grid input {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 12px;
  width: 100%;
}

#config-grid input:focus {
  outline: none;
  border-color: #7c3aed;
}

/* --- Coordinates display --- */

#coords {
  position: fixed;
  bottom: 30px;
  right: 10px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'SF Mono', Monaco, monospace;
  pointer-events: none;
}

/* --- Meta section --- */

#meta-summary {
  margin-bottom: 4px;
}

#meta-sources summary {
  cursor: pointer;
  color: #8b949e;
  font-size: 12px;
}

#meta-sources summary:hover {
  color: #c9d1d9;
}

#meta-sources table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 6px;
}

#meta-sources th,
#meta-sources td {
  text-align: left;
  padding: 2px 6px;
  border-bottom: 1px solid #21262d;
}

#meta-sources th {
  color: #8b949e;
  font-weight: 600;
}

#meta-sources .failed {
  color: #f85149;
  font-weight: 600;
}

/* --- Inspect popup --- */

.inspect-popup {
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}

.inspect-popup strong {
  color: #333;
}
