* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
  background: #f8fafc;
  height: 100%;
}
#app {
  display: grid;
  grid-template-rows: 56px 1fr 32px;
  height: 100dvh;
}
#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #1e3a8a;
  color: white;
}
.brand { font-weight: 700; color: white; text-decoration: none; }
.tag { font-size: 12px; opacity: 0.8; }
.spacer { flex: 1; }
.ghost-btn {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

#main { position: relative; overflow: hidden; }

.drop-zone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 3px dashed transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}
.drop-content {
  max-width: 560px;
  text-align: center;
  padding: 24px;
}
.drop-content h1 { margin: 0 0 8px 0; color: #1e3a8a; }
.drop-content p { color: #4b5563; line-height: 1.5; }
.pick-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: #2563eb;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}
.pick-btn:hover { background: #1d4ed8; }

.viewer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 320px;
}
#map { width: 100%; height: 100%; }
.sidebar {
  overflow-y: auto;
  padding: 16px;
  background: white;
  border-left: 1px solid #e5e7eb;
}
.sidebar h2 { margin: 0 0 4px 0; font-size: 15px; word-break: break-all; }
.summary { color: #6b7280; font-size: 12px; margin-bottom: 12px; }
.section { margin-top: 16px; }
.section h3 {
  margin: 0 0 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.5px;
}
.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.layer-item label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.count { color: #6b7280; font-variant-numeric: tabular-nums; font-size: 12px; }

.export-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.primary-btn {
  background: #1e3a8a;
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease;
}
.primary-btn:hover:not(:disabled) { background: #1e40af; }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #e5e7eb;
  font-size: 12px;
  color: #4b5563;
}
#footer a { color: #1e3a8a; text-decoration: none; font-weight: 600; }

@media (max-width: 800px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { border-left: none; border-top: 1px solid #e5e7eb; max-height: 50dvh; }
}
