* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  font: 14px/1.4 system-ui, sans-serif;
  color: #222;
}

#sidebar {
  width: 340px;
  flex: none;
  overflow-y: auto;
  padding: 12px;
  border-right: 1px solid #ccc;
  background: #fafafa;
}

#map { flex: 1; min-width: 0; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

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

button, .button {
  font: inherit;
  padding: 4px 10px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

button:hover, .button:hover { background: #eee; }
button.primary { background: #1a73e8; border-color: #1a73e8; color: #fff; }
button.danger { color: #b00020; border-color: #b00020; }

#upload { margin-bottom: 12px; }
#upload .button { display: inline-block; }

.hint { color: #666; margin: 6px 0; }
.error, #message.error { color: #b00020; }

#message {
  margin: 0 0 12px;
  padding: 6px 8px;
  border-radius: 4px;
  background: #eef3fd;
  white-space: pre-line;
}

#message.error { background: #fdecee; }

#imports { list-style: none; margin: 0; padding: 0; }

#imports li {
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

#imports li.selected {
  border-color: #1a73e8;
  box-shadow: 0 0 0 1px #1a73e8;
}

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

.row input[type="color"] {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #999;
  border-radius: 4px;
  background: none;
  flex: none;
}

.name {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.name:hover { background: none; text-decoration: underline; }

.notes {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.actions { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }

.edit input[type="text"], .edit textarea, dialog input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 4px 6px;
  font: inherit;
  border: 1px solid #999;
  border-radius: 4px;
}

.edit textarea { min-height: 90px; resize: vertical; }

#drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 115, 232, 0.25);
  border: 4px dashed #1a73e8;
  font-size: 24px;
  font-weight: 600;
  pointer-events: none;
}

#drop-overlay[hidden] { display: none; }

dialog { border: 1px solid #999; border-radius: 8px; padding: 16px; width: 300px; max-width: 90vw; }

@media (max-width: 700px) {
  body { flex-direction: column; }
  #sidebar { width: auto; max-height: 45%; border-right: 0; border-bottom: 1px solid #ccc; }
}
