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

body {
  display: flex;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #333;
}

#sidebar {
  width: 320px;
  min-width: 320px;
  height: 100vh;
  overflow-y: auto;
  padding: 16px;
  background: #f8f8f8;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#sidebar h1 {
  font-size: 20px;
  font-weight: 600;
}

#map {
  flex: 1;
  height: 100vh;
}

/* Controls */
#controls-top,
#controls-bottom {
  display: flex;
  gap: 8px;
}

button {
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

button:hover:not(:disabled) {
  background: #e8e8e8;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#btn-export,
#btn-download {
  flex: 1;
  font-weight: 600;
}

#btn-export {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

#btn-export:hover:not(:disabled) {
  background: #1d4ed8;
}

#btn-download {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}

#btn-download:hover:not(:disabled) {
  background: #15803d;
}

/* Feature List */
#feature-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.feature-group {
  margin-bottom: 8px;
}

.feature-global-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.feature-global-controls button {
  flex: 1;
  padding: 4px 8px;
  font-size: 12px;
}

.feature-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #888;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
  cursor: pointer;
}

.feature-group-header input[type="checkbox"] {
  margin: 0;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 4px;
}

.feature-item:hover {
  background: #f0f0f0;
}

.feature-item input[type="checkbox"] {
  margin: 0;
}

.feature-item label {
  cursor: pointer;
  flex: 1;
  font-size: 13px;
}

.feature-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}

/* Status */
#status {
  font-size: 12px;
  color: #666;
  min-height: 18px;
}

#status.error {
  color: #dc2626;
}

#status.loading {
  color: #2563eb;
}

/* SVG Preview */
#svg-preview {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  display: none;
  overflow: hidden;
}

#svg-preview.visible {
  display: block;
}

#svg-preview svg {
  width: 100%;
  height: auto;
}
