html, body {
  margin: 0;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
}

body {
  display: flex;
  background: #f3f4f6;
}

.sidebar {
  width: 360px;
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #d1d5db;
}

.subtitle {
  margin-top: 4px;
  color: #4b5563;
}

.panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.row label {
  margin-bottom: 4px;
  font-size: 13px;
  color: #374151;
}

.row input {
  padding: 8px;
  border: 1px solid #9ca3af;
  border-radius: 6px;
  font-size: 14px;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

button {
  cursor: pointer;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

button.secondary {
  background: #ffffff;
  color: #1f2937;
  border-color: #9ca3af;
}

button.danger {
  margin-top: 8px;
  background: #b91c1c;
  border-color: #b91c1c;
}

button.primary {
  width: 100%;
}

#initialize-assets {
  margin-top: 10px;
  width: 100%;
}

button.small {
  padding: 6px 10px;
  font-size: 12px;
}

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

.summary {
  margin-top: 10px;
  font-size: 13px;
  color: #374151;
}

.summary.error {
  color: #b91c1c;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
}

.data-group {
  margin-top: 14px;
}

.data-group-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}

.data-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

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

.data-link {
  color: #1d4ed8;
  text-decoration: none;
}

.data-link:hover {
  text-decoration: underline;
}

.data-size {
  flex-shrink: 0;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}

.data-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-dot.present {
  background: #16a34a;
}

.status-dot.absent {
  background: #dc2626;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
}

.legend-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.legend-swatch.cached {
  background: rgba(22, 163, 74, 0.35);
  border: 2px solid #16a34a;
  box-sizing: border-box;
}

.legend-swatch.pending {
  background: rgba(234, 179, 8, 0.35);
  border: 2px dashed #ca8a04;
  box-sizing: border-box;
}

.legend-swatch.query {
  background: rgba(56, 189, 248, 0.22);
  border: 2px solid #0284c7;
  box-sizing: border-box;
}

.map-container {
  flex: 1;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
}

.hidden {
  display: none !important;
}

.context-menu {
  position: absolute;
  z-index: 20;
  min-width: 160px;
  background: rgba(17, 24, 39, 0.96);
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.context-menu button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.floating-panel {
  position: absolute;
  z-index: 15;
  width: 340px;
  max-height: calc(100% - 24px);
  overflow: hidden;
  background: rgba(17, 24, 39, 0.94);
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

#feature-list-panel {
  top: 12px;
  right: 12px;
}

#feature-detail-panel {
  top: 12px;
  right: 368px;
}

.floating-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.floating-panel-summary {
  padding: 10px 12px 0;
  color: #d1d5db;
  font-size: 13px;
}

.feature-list {
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding: 10px 12px 12px;
}

.feature-list-item {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f9fafb;
  text-align: left;
}

.feature-list-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.feature-list-item.selected {
  border-color: #f59e0b;
}

.feature-list-item strong {
  display: block;
  margin-bottom: 4px;
}

.feature-meta {
  color: #d1d5db;
  font-size: 12px;
}

.detail-panel {
  width: 420px;
}

.feature-detail-body {
  margin: 0;
  padding: 12px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.4;
  color: #f9fafb;
}
