@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');
/* ============================================================
   DESIGN TOKENS — E95674 / 9E53E4 Dark Theme
============================================================ */
:root {

/* ============================================================
   CORE TOKENS
============================================================ */

  --accent-red:    #E95674;
  --accent-purple: #9E53E4;
  --accent-grad:   linear-gradient(135deg, #E95674 0%, #9E53E4 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(233,86,116,0.15) 0%, rgba(158,83,228,0.15) 100%);

  --bg-base:       #0a0a0a;
  --bg-surface:    #111111;
  --bg-elevated:   #1a1a1a;
  --bg-overlay:    #222222;
  --bg-hover:      #2a2a2a;

  --border:        #2a2a2a;
  --border-mid:    #333333;
  --border-bright: #444444;

  --text-primary:   #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted:     #606060;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;

  --font-ui:   "Exo 2", sans-serif;
  --font-mono: "Ubuntu Mono", monospace;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.7);

  --transition: 0.15s ease;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
}

.unselectable {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE 10+ and Edge */
  user-select: none; /* Standard syntax */
}

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BETA TAG
============================================================ */
.beta-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(233,86,116,0.3);
  border-radius: var(--radius-sm);
  color: #E95674;
  text-transform: uppercase;
  display: inline-block;
}

/* ============================================================
   TOP NAVIGATION
============================================================ */
.nav {
  width: 100%;
  height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 3;
  flex-shrink: 0;
  user-select: none;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
  width: 100%;
}

.company-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
}

/* ============================================================
   SOFTWARE NAV CONTAINER
============================================================ */
.software-nav-container {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 0 8px;
  user-select: none;
  height: 100%;
  width: 100%;
  justify-content: space-between;
}

/* ============================================================
   NAV INFO PANEL
============================================================ */
.nav-info-panel {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--border-mid);
  width: 220px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.nav-info-panel.active { opacity: 1; }

.nav-info-heading {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-red);
  line-height: 1.2;
}

.nav-info-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ============================================================
   MENU TRIGGERS & DROPDOWNS
============================================================ */
.menu-trigger {
  padding: 8px 14px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  white-space: nowrap;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.menu-trigger:hover,
.menu-trigger.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: var(--bg-elevated);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  z-index: 10;
  padding: 4px;
  overflow: hidden;
}

.menu-trigger.active .menu-dropdown { display: block; }

.menu-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.menu-item:hover {
  background: var(--accent-grad-soft);
  color: var(--text-primary);
}

.menu-item-shortcut {
  font-size: 11px;
  opacity: 0.5;
  font-family: var(--font-mono);
}

.menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================================================
   CONTAINER / LAYOUT
============================================================ */
.container {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--bg-base);
  height: 100vh;
  overflow: hidden;
}

.workable {
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 0;
}


/* ============================================================
   CANVAS OPTIONS
============================================================ */
.canvas-options {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.canvas-options.hidden { display: none; }

/* ============================================================
   STATS SIDEBAR
============================================================ */
.stats-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-mid);
  box-shadow: var(--shadow-lg);
  transform: translateX(50vw);
  transition: transform 0.25s ease;
  z-index: 1;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.stats-sidebar.open {
  transform: translateX(0);
  pointer-events: all;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.stats-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.stats-header button {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.stats-header button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.stats-content {
  padding: 0;
  overflow-y: auto;
  padding-bottom: 25vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.stats-content::-webkit-scrollbar { width: 4px; }
.stats-content::-webkit-scrollbar-track { background: transparent; }
.stats-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.stats-content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   TOGGLE BUTTON
============================================================ */
.stats-toggle-btn {
  position: absolute;
  top: 20px;
  right: 10px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  z-index: 3;
  transition: all var(--transition);
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-toggle-btn.focus { right: 56px; }

.stats-toggle-btn:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-bright);
  color: var(--text-primary) !important;
}

.stats-toggle-btn.active {
  color: #fff;
  background: var(--accent-grad) !important;
  border: none;
}

.stats-toggle-btn.active:hover {
  opacity: 0.85;
  background: var(--accent-grad) !important;
}

/* ============================================================
   GLOBAL BUTTON RESET
============================================================ */
button {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.4px;
  transition: all var(--transition);
}

button:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-bright);
}

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

/* ============================================================
   OPTION BUTTONS
============================================================ */
.option-btn {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-ui);
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition);
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent-purple);
  background: rgba(158,83,228,0.06);
  color: var(--text-primary);
}

.option-btn.active {
  border-color: var(--accent-red);
  background: rgba(233,86,116,0.08);
  color: var(--text-primary);
}

.option-btn:disabled {
  border-color: var(--border);
  background: var(--bg-base);
  color: var(--text-muted);
  cursor: not-allowed;
}

.option-btn .desc {
  font-size: 10px;
  margin-top: 4px;
  line-height: 1.4;
  color: var(--text-muted);
}

.option-btn.coming-soon::after {
  content: "COMING SOON";
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

/* ============================================================
   BUTTON GROUP
============================================================ */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============================================================
   CHAT PANEL
============================================================ */
.chat-panel {
  display: flex;
  flex-direction: column;
  width: 30vw;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-mid);
  color: var(--text-primary);
  z-index: 2;
  opacity: 1;
  transition: width 0.4s ease, opacity 0.4s ease;
}

.chat-panel.collapsed {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

.chat-header {
  background: var(--bg-elevated);
  padding: 16px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.chat-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-grad);
  opacity: 0.4;
}

.chat-header h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 3px;
  color: var(--text-primary);
}

.chat-header p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   MESSAGES CONTAINER
============================================================ */
.messages-container {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 16px 20vh 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 14px;
  background: var(--bg-base);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.messages-container::-webkit-scrollbar { width: 4px; }
.messages-container::-webkit-scrollbar-track { background: transparent; }
.messages-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.messages-container::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   MESSAGES
============================================================ */
.message {
  display: flex;
  gap: 10px;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-message { justify-content: flex-start; }

.ai-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.ai-text {
  background: var(--bg-elevated);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  max-width: 100%;
}

.ai-text strong { color: var(--text-primary); }

.message-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   ACTION CONTAINERS
============================================================ */
.action-container {
  background: var(--bg-elevated);
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-purple);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius-sm);
}

.action-container input[type="number"] {
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  width: 100%;
}

.action-container input[type="number"]::-webkit-outer-spin-button,
.action-container input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.action-container input[type="number"] { -moz-appearance: textfield; }

.action-container input[type="number"]:hover { border-color: var(--border-bright); }
.action-container input[type="number"]:focus { border-color: var(--accent-purple); outline: none; }
.action-container input[type="number"]:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ============================================================
   ERROR / SUCCESS MESSAGES
============================================================ */
.error-message {
  background: rgba(233,86,116,0.06);
  border: 1px solid rgba(233,86,116,0.3);
  border-left: 3px solid var(--accent-red);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--accent-red);
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  justify-content: flex-start;
}

.success-message {
  background: rgba(78,201,176,0.06);
  border: 1px solid rgba(78,201,176,0.25);
  border-left: 3px solid #4ec9b0;
  padding: 10px 14px;
  font-size: 12px;
  color: #4ec9b0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  justify-content: flex-start;
}

.error-message::before { content: "⚠"; font-size: 13px; }

/* ============================================================
   STATS GRID & CARDS
============================================================ */
.stats-grid { display: grid; gap: 12px; }

.stat-group {
  background: var(--bg-elevated);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--border);
}

.stat-group h3 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  color: var(--accent-purple);
}

.stat-group p {
  line-height: 1.6;
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

.stat-group .sub { color: var(--text-muted); margin-top: 6px; }
.stat-group .indent { margin-left: 12px; }

.stat-message {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-header strong {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 700;
}

.stat-header .ts {
  background: var(--bg-hover);
  border: 1px solid var(--border-mid);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stat-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.stat-card {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-mid);
  background: var(--bg-elevated);
}

.stat-card.stat-pop {
  animation: popAnimation 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popAnimation {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.stat-icon {
  font-size: 22px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

.stat-details { flex: 1; }

.parking-card { border-left: 2px solid var(--accent-red); }
.driveway-card { border-left: 2px solid var(--accent-purple); }

.stat-grid-small {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-item-small .label {
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-item-small .value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 3px;
  font-family: var(--font-mono);
}

.stat-actions { display: flex; gap: 8px; justify-content: flex-end; }

.btn.small {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all var(--transition);
}

.btn.small:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
}

/* ============================================================
   FEATURE LIST
============================================================ */
.feature-list { text-align: left; display: inline-block; }

.feature-item {
  display: flex;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.feature-item::before {
  content: "✓";
  display: inline-flex;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  background: var(--accent-grad);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  flex-shrink: 0;
}

/* ============================================================
   BOTTOM NAVIGATION
============================================================ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  z-index: 3;
  pointer-events: all;
  border-top: 1px solid var(--border);
  width: 100%;
  padding: 0 8px;
  height: 34px;
}

.bottom-nav-group {
  display: flex;
  width: max-content;
  background: transparent;
  padding: 0;
  gap: 0;
  height: 100%;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  padding-right: 4px;
}

.bottom-nav .nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0 14px;
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 0;
  white-space: nowrap;
  width: max-content;
  letter-spacing: 0.5px;
  height: 100%;
  text-transform: uppercase;
}

.bottom-nav .nav-btn:not(.active):hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.bottom-nav .nav-btn.active {
  color: #fff;
  position: relative;
}

.bottom-nav .nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-grad);
}

.bottom-nav .visibility-btn {
  color: var(--accent-purple);
  font-weight: 600;
}

.bottom-nav .visibility-btn:hover {
  background: rgba(158,83,228,0.1);
}

/* ============================================================
   VISIBILITY PANEL
============================================================ */
.visibility-panel {
  width: max-content;
  height: 100%;
  position: relative;
}

.visibility-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(158,83,228,0.08);
  border: 1px solid rgba(158,83,228,0.2);
  padding: 0 12px;
  height: 100%;
  cursor: pointer;
  letter-spacing: 0.5px;
  gap: 8px;
  border-radius: var(--radius-sm);
  margin: auto 0;
  transition: all var(--transition);
}

.visibility-header:hover {
  background: rgba(158,83,228,0.15);
  border-color: rgba(158,83,228,0.4);
}

.visibility-header h3 {
  font-size: 11px;
  font-weight: 700;
  margin: 0;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

#toggleVisibilityBtn {
  background: transparent;
  color: var(--accent-purple);
  border: none;
  border-radius: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visibility-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.2s ease;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  position: absolute;
  bottom: 42px;
  left: 0;
  min-width: 200px;
}

.visibility-panel.expanded .visibility-content {
  max-height: 300px;
  opacity: 1;
}

.visibility-panel.expanded #toggleVisibilityBtn {
  transform: rotate(180deg);
}

.visibility-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.visibility-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.visibility-item:hover { background: var(--bg-hover); }

.visibility-item input[type="checkbox"] {
  accent-color: var(--accent-purple);
  transform: scale(0.85);
  cursor: pointer;
}

.visibility-item label {
  flex: 1;
  margin-left: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ============================================================
   LOADING / SPINNER
============================================================ */
.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent-purple);
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(158,83,228,0.25);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PROGRESS OVERLAY
============================================================ */
.progress-overlay {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-lg);
  width: 300px;
  min-width: 240px;
  pointer-events: auto;
  transition: all 0.2s ease;
  opacity: 0;
  transform: translateY(8px) translateX(-50%);
}

.progress-overlay.active .progress-card {
  opacity: 1;
  transform: translateY(0) translateX(-50%);
}

.progress-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.progress-message {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.progress-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 14px;
}

.ai-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.ai-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.2;
  animation: aiPulse 1.1s infinite ease-in-out;
}

.ai-dots span:nth-child(1) { background: var(--accent-red);    animation-delay: 0s; }
.ai-dots span:nth-child(2) { background: #c44fc0;              animation-delay: 0.15s; }
.ai-dots span:nth-child(3) { background: var(--accent-purple); animation-delay: 0.3s; }

@keyframes aiPulse {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-3px); }
}

.progress-percent {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.progress-close {
  border: 1px solid var(--border-mid);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  border-radius: var(--radius-sm);
  opacity: 0.6;
  width: 26px;
  height: 26px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-close:hover {
  opacity: 1;
  color: #fff !important;
  background: var(--bg-hover) !important;
  border-color: var(--border-bright);
}

.progress-overlay[hidden] { display: none; }

/* ============================================================
   UPLOAD AREAS
============================================================ */
.upload-area {
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-base);
  color: var(--text-muted);
}

.upload-area:hover {
  border-color: var(--accent-purple);
  background: rgba(158,83,228,0.04);
  color: var(--text-secondary);
}

.upload-area.dragover {
  border-color: var(--accent-red);
  background: rgba(233,86,116,0.06);
  color: var(--text-primary);
}

.upload-area p { margin: 0; font-size: 12px; }

.file-upload-container {
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-base);
  color: var(--text-muted);
}

.file-upload-container:hover {
  border-color: var(--accent-purple);
  background: rgba(158,83,228,0.04);
}

.file-upload-container.dragover {
  border-color: var(--accent-red);
  background: rgba(233,86,116,0.06);
}

.file-upload-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-upload-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

#fileInput { display: none; }

/* ============================================================
   TOOLTIP
============================================================ */
[data-tooltip] { position: relative; }

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-overlay);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  white-space: nowrap;
  z-index: 100;
  font-family: var(--font-ui);
  letter-spacing: 0.3px;
}

/* ============================================================
   CANVAS & SIDEBAR IDs
============================================================ */
#canvas {
  flex: 1;
  background: var(--bg-elevated);
}

#sidebar {
  width: 340px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 420px) {
  .progress-message { font-size: 11px; }
  .progress-percent  { font-size: 10px; }
}