:root {
  --bg-dark: rgba(9, 9, 11, 0.80);
  --bg-card: rgba(9, 9, 11, 0.96);
  --bg-section: rgba(24, 24, 27, 0.65);
  --bg-accent-hover: #27272a;
  --border-subtle: #27272a;
  --border-highlight: rgba(16, 185, 129, 0.45);
  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-orange: #10b981;
  --accent-orange-hover: #34d399;
  --accent-green: #10b981;
  --accent-green-bright: #34d399;
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d140f;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#labels-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  contain: layout style paint;
}

/* Loading Screen */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at center, #18261c 0%, #0b110d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.45s ease;
}

#loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.loader-card {
  width: 100%;
  max-width: 410px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.loader-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--accent-orange);
  background: rgba(255, 125, 25, 0.14);
  border: 1px solid rgba(255, 125, 25, 0.35);
  padding: 4px 11px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.loader-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.loader-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-orange));
  border-radius: 99px;
  transition: width 0.2s ease;
}

.loader-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}


/* Toast */
.toast {
  position: fixed;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 82px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(16, 24, 19, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 125, 25, 0.65);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.hidden {
  display: none !important;
}


/* ============================================================================
   SHARED UTILITY CLASSES (CLEANED FROM INLINE STYLES)
   ============================================================================ */
.mt-2 { margin-top: 2px; }
.mt-5 { margin-top: 5px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 2px; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.flex-1 { flex: 1; }
.flex-row-gap-6 {
  display: flex;
  gap: 6px;
}
.flex-between-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.text-center { text-align: center; }
.text-warn-req { color: #facc15; }
