:root {
  --bg: #0b0f19;
  --card: #131a2a;
  --text: #e8ecf5;
  --muted: #94a3b8;
  --primary: #7c6cff;
  --border: #25304a;
  --radius: 12px;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* Base styles matching React app */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--primary); color: #fff; border: 1px solid transparent;
  border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: rgba(255,255,255,0.05); }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* Builder Layout */
.builder { 
  display: grid; 
  grid-template-columns: 360px 1fr; 
  height: calc(100vh - 64px); 
  background: #020617; 
}

.builder .left { 
  background: #0f172a; 
  border-right: 1px solid var(--border); 
  display: flex; 
  flex-direction: column; 
}

.builder .right { 
  display: flex; 
  flex-direction: column; 
  background: #020617; 
}

/* Tabs */
.b-tabs { display: flex; padding: 8px; gap: 4px; border-bottom: 1px solid var(--border); }
.tab-btn { 
  flex: 1; padding: 8px; background: transparent; border: 0; 
  color: var(--muted); cursor: pointer; border-radius: 6px; 
  font-size: 13px; font-weight: 500;
}
.tab-btn.on { background: #1e293b; color: #fff; }

/* Header within builder */
.b-head { 
  display: flex; gap: 12px; align-items: center; 
  padding: 12px 20px; border-bottom: 1px solid var(--border); 
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(8px);
}

/* Scrollable Chat Area */
.b-scroll { 
  flex: 1; overflow-y: auto; padding: 20px; 
  display: flex; flex-direction: column; gap: 16px; 
}
.chat-prompt { 
  background: #1e293b; color: #fff; border-radius: 8px 8px 0 8px; 
  padding: 10px 14px; font-size: 14px; align-self: flex-end; max-width: 90%;
}

/* Form / Prompt Input */
.b-form { padding: 16px; border-top: 1px solid var(--border); }
.prompt-wrap { 
  background: #1e293b; border: 1px solid var(--border); 
  border-radius: 12px; padding: 10px; display: flex; flex-direction: column; 
}
.prompt-wrap textarea { 
  background: transparent; border: 0; color: #fff; 
  width: 100%; resize: none; min-height: 80px; 
  outline: none; font-size: 14px;
}
.prompt-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.prompt-btn { color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.prompt-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.prompt-btn.primary { background: var(--primary); color: #fff; border-radius: 6px; padding: 6px; }

/* Preview Frame */
.frame-wrap { flex: 1; padding: 12px; display: grid; place-items: center; overflow: hidden; background: rgba(0,0,0,0.2); }
.preview-container { 
  background: #fff; border-radius: 8px; overflow: hidden; 
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); 
  width: 100%; height: 100%; transition: width 0.3s ease;
}
iframe.preview { width: 100%; height: 100%; border: 0; }

/* File List */
.file-list { 
  display: flex; gap: 8px; padding: 8px 20px; 
  background: #020617; border-bottom: 1px solid var(--border); 
  overflow-x: auto; 
}
.file-list button { 
  background: transparent; border: 1px solid var(--border); 
  color: var(--muted); padding: 4px 10px; border-radius: 4px; 
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.file-list button.on { border-color: var(--primary); color: #fff; background: rgba(124, 108, 255, 0.1); }

/* Code Editor */
.code-area { flex: 1; display: none; }
.code-area textarea { 
  width: 100%; height: 100%; background: #020617; 
  color: #94a3b8; border: 0; padding: 20px; 
  font-family: monospace; outline: none; font-size: 14px;
}

/* Mockups */
.mockup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mockup-item { 
  position: relative; border-radius: 8px; overflow: hidden; 
  aspect-ratio: 16/10; cursor: pointer; border: 1px solid var(--border);
}
.mockup-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.mockup-overlay { 
  position: absolute; inset: 0; background: rgba(0,0,0,0.4); 
  display: flex; align-items: flex-end; padding: 8px; font-size: 11px; font-weight: bold;
}
.mockup-item:hover img { opacity: 1; }

select { background: #1e293b; color: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12px; }
