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

/* HTML `hidden` attribute should always win over our display rules. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: #222;
  background: #fff;
}

body { display: flex; height: 100vh; overflow: hidden; }

/* ---- Sidebar ------------------------------------------------------------ */
#sidebar {
  width: 380px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  background: #f7f7f8;
  border-right: 1px solid #e4e4e7;
  padding: 1.25rem;
}

#sidebar header h1 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.muted { color: #6b7280; font-size: 0.82rem; }
.hint  { color: #6b7280; font-size: 0.78rem; margin-top: 0.4rem; }

#sidebar h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
}

/* ---- Dropzone ----------------------------------------------------------- */
#dropzone {
  display: block;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
#dropzone:hover            { border-color: #94a3b8; }
#dropzone.dragging         { border-color: #3b82f6; background: #eff6ff; }
#dropzone input            { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
#dropzone-label strong     { display: block; font-size: 0.95rem; }
code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78em;
  background: #eef2f7;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ---- Status ------------------------------------------------------------- */
#status-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  font-size: 0.85rem;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-idle       { background: #9ca3af; }
.status-ready      { background: #22c55e; }
.status-processing { background: #f59e0b; animation: pulse 1.5s ease-in-out infinite; }
.status-error      { background: #ef4444; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

#progress { width: 100%; margin-top: 0.5rem; height: 4px; }

/* ---- Detail blocks ------------------------------------------------------ */
.info-block {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
}
.info-block h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.info-block dl   { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; font-size: 0.82rem; }
.info-block dt   { color: #6b7280; }
.info-block dd   { word-break: break-all; font-variant-numeric: tabular-nums; }
.info-block a    { color: #2563eb; text-decoration: none; }
.info-block a:hover { text-decoration: underline; }
.copy-btn {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.4rem;
}
.copy-btn:hover { background: #f1f5f9; }
.copy-btn.copied { background: #dcfce7; border-color: #22c55e; }

#sidebar details {
  margin-top: 0.6rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
#sidebar summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #4b5563;
  user-select: none;
}
#sidebar pre {
  margin-top: 0.5rem;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  background: #f8fafc;
  padding: 0.6rem;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
}

#empty-state .empty-card {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}

/* ---- Map ---------------------------------------------------------------- */
#map-container { flex: 1; position: relative; height: 100vh; }
#map { width: 100%; height: 100%; }

#map-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
#map-empty-overlay h3 { font-weight: 500; margin-bottom: 0.4rem; }

/* MapLibre tweaks */
.maplibregl-ctrl-attrib { font-size: 0.7rem; }
