/* ═══════════════════════════════════════════ */
/*  HeatFries AI Bot Builder — Styles         */
/* ═══════════════════════════════════════════ */

:root {
  --bg-dark: #060a13;
  --bg-card: #0c1220;
  --bg-surface: rgba(255,255,255,0.025);
  --bg-input: #0a0f1a;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(0,212,255,0.25);
  --text-primary: #f0f4f8;
  --text-secondary: #c4cdd8;
  --text-muted: #6b7a8d;
  --accent: #00d4ff;
  --accent-dim: rgba(0,212,255,0.1);
  --green: #10b981;
  --green-dim: rgba(16,185,129,0.1);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.1);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.1);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.1);
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══ NAV ═══ */
.navbar {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: rgba(6,10,19,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  display: flex; justify-content: space-between; align-items: center;
}
.logo {
  font-size: 1.15rem; font-weight: 800;
  text-decoration: none; color: var(--text-primary);
}
.logo span {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.82rem; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.nav-auth { display: flex; align-items: center; gap: 0.75rem; }
.btn-deriv-login {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem; border-radius: 2rem;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border-accent);
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-deriv-login:hover { background: rgba(0,212,255,0.2); }
.user-info { display: flex; align-items: center; gap: 0.5rem; }
.user-id { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.credits-badge {
  padding: 0.25rem 0.6rem; border-radius: 2rem;
  background: var(--green-dim); color: var(--green);
  font-size: 0.72rem; font-weight: 700;
}
.btn-logout {
  background: rgba(255,77,77,0.12); color: #ff4d4d; border: 1px solid rgba(255,77,77,0.25);
  padding: 0.25rem 0.6rem; border-radius: 0.4rem; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,77,77,0.25); }

/* ═══ MAIN ═══ */
.builder-main {
  max-width: 900px; margin: 0 auto;
  padding: 5.5rem 1.5rem 3rem;
}

/* ═══ HEADER ═══ */
.builder-header {
  text-align: center; margin-bottom: 2.5rem;
  position: relative;
}
.header-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(0,212,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.builder-header h1 {
  font-size: 2.2rem; font-weight: 900;
  letter-spacing: -0.03em; margin-bottom: 0.5rem;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.builder-header p {
  color: var(--text-muted); font-size: 0.88rem;
  line-height: 1.6; max-width: 640px; margin: 0 auto;
}

/* ═══ DERIV CTA BOX ═══ */
.deriv-cta-box {
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(168,85,247,0.06));
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 14px; padding: 1.25rem 1.5rem;
}
.deriv-cta-content {
  display: flex; align-items: center; gap: 1rem;
}
.deriv-cta-icon {
  font-size: 2rem; flex-shrink: 0;
}
.deriv-cta-text {
  flex: 1;
}
.deriv-cta-text h3 {
  font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 0.25rem;
}
.deriv-cta-text p {
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin: 0;
}
.btn-deriv-cta {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 0.65rem 1.25rem; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #00d4ff, #a855f7);
  color: #fff; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
  flex-shrink: 0;
}
.btn-deriv-cta:hover {
  transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}
@media (max-width: 640px) {
  .deriv-cta-content { flex-direction: column; text-align: center; }
  .btn-deriv-cta { width: 100%; justify-content: center; }
}

/* ═══ STEP SECTIONS ═══ */
.step-section { margin-bottom: 2rem; }
.step-section.hidden { display: none; }
.step-label {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary); margin-bottom: 1rem;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent); color: #000;
  font-size: 0.72rem; font-weight: 800;
}

/* ═══ CONFIG PANEL ═══ */
.config-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Mode Tabs (legacy - replaced by panel header) */
.mode-tabs { display: none; }

/* Config Panel Header */
.config-panel-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.config-panel-title {
  display: block;
  font-size: 1rem; font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.config-panel-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Strategy Notes */
.strategy-notes { margin-top: 0.5rem; }
.strategy-notes textarea {
  min-height: 80px;
  border-color: var(--border-accent) !important;
  background: rgba(0,210,255,0.03) !important;
}
.notes-badge {
  display: inline-block;
  font-size: 0.68rem; font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
}

/* Form */
.form-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-bottom: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
}
.form-group .optional { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Deriv rule hints */
.deriv-hint {
  font-size: 0.68rem;
  color: #f0ad4e;
  font-weight: 500;
  margin-top: 0.15rem;
  line-height: 1.3;
}
select option:disabled {
  color: #555;
}

select, input[type="number"], textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 0.82rem; transition: border-color 0.2s;
  width: 100%;
}
select:hover, input:hover, textarea:hover { border-color: rgba(255,255,255,0.12); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 2.5rem; }

.input-row { display: flex; gap: 0.5rem; }
.input-row input { flex: 1; }
.input-row select { flex: 1; }

/* Advanced */
.advanced-section {
  margin-bottom: 1rem; padding: 0.75rem;
  background: var(--bg-surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.advanced-section summary {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  list-style: none;
}
.advanced-section summary::before { content: '▸ '; }
.advanced-section[open] summary::before { content: '▾ '; }
.advanced-section .form-grid { margin-top: 0.75rem; margin-bottom: 0; }

/* Prompt Form */
.prompt-form textarea {
  font-size: 0.88rem; line-height: 1.6;
  min-height: 120px;
}

/* Prompt Warning */
.prompt-warning {
  margin-top: 0.75rem; padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid rgba(255, 170, 0, 0.3);
  font-size: 0.85rem; line-height: 1.5;
}
.pw-header {
  font-size: 0.95rem; font-weight: 700;
  color: #ffaa00; margin-bottom: 0.6rem;
}
.pw-section { margin-bottom: 0.5rem; }
.pw-section ul { margin: 0.25rem 0 0 1.2rem; padding: 0; }
.pw-section li { margin-bottom: 0.2rem; }
.pw-tag {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 3px; font-size: 0.8rem; margin-right: 0.3rem;
}
.pw-ok { background: rgba(0,212,255,0.12); color: var(--accent); }
.pw-issues { color: #ff6b6b; }
.pw-issues li { color: #ff9999; }
.pw-tip {
  margin-top: 0.5rem; padding: 0.5rem 0.75rem;
  background: rgba(0,212,255,0.06); border-radius: 4px;
  color: var(--text-dim); font-size: 0.82rem;
}
.pw-actions {
  display: flex; gap: 0.75rem; margin-top: 0.75rem;
}
.pw-btn {
  padding: 0.5rem 1.25rem; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.pw-btn-fix {
  background: var(--accent); color: #000;
}
.pw-btn-fix:hover { opacity: 0.85; }
.pw-btn-force {
  background: rgba(255,255,255,0.08); color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.15);
}
.pw-btn-force:hover { background: rgba(255,255,255,0.12); }
.pw-rewrite {
  margin-top: 0.75rem; padding: 0.75rem; background: rgba(0,200,150,0.08);
  border: 1px solid rgba(0,200,150,0.3); border-radius: 6px;
}
.pw-rewrite strong { color: #00c896; display: block; margin-bottom: 0.4rem; font-size: 0.85rem; }
.pw-rewrite-text {
  color: #e0e0e0; font-size: 0.85rem; line-height: 1.5; font-style: italic;
  padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: 4px;
}

/* Build Button */
.btn-build {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; width: 100%; margin-top: 1.25rem;
  padding: 0.85rem 2rem; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #0090b0);
  color: #000; font-family: inherit;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-build:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,212,255,0.3); }
.btn-build:disabled {
  opacity: 0.5; cursor: not-allowed;
  transform: none; box-shadow: none;
}

/* ═══ BUILD PANEL ═══ */
.build-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem; overflow: hidden;
}

/* Progress Pipeline */
.progress-pipeline {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.pipeline-step {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.82rem; color: var(--text-muted);
  opacity: 0.4; transition: all 0.4s ease;
}
.pipeline-step.active {
  opacity: 1; color: var(--accent);
  background: var(--accent-dim);
}
.pipeline-step.done {
  opacity: 1; color: var(--green);
}
.pipeline-step.error {
  opacity: 1; color: var(--red);
  background: var(--red-dim);
}

.ps-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ps-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
}
.pipeline-step.active .ps-spinner { animation: spin 0.8s linear infinite; }
.pipeline-step.done .ps-spinner {
  border: none; width: auto; height: auto;
  animation: none;
}
.pipeline-step.done .ps-spinner::after { content: '✓'; color: var(--green); font-weight: 700; font-size: 0.85rem; }
.pipeline-step.error .ps-spinner {
  border: none; animation: none;
}
.pipeline-step.error .ps-spinner::after { content: '✗'; color: var(--red); font-weight: 700; font-size: 0.85rem; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Code Viewer */
.code-viewer {
  background: #0a0e17;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.code-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }
.code-title {
  font-size: 0.72rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-left: 0.5rem;
}
.code-stats {
  margin-left: auto; font-size: 0.68rem;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
}

.code-content {
  padding: 1rem; margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; line-height: 1.65;
  color: #8892b0;
  max-height: 400px; overflow-y: auto;
  white-space: pre-wrap; word-wrap: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.code-content::-webkit-scrollbar { width: 6px; }
.code-content::-webkit-scrollbar-track { background: transparent; }
.code-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Syntax highlighting helpers */
.code-content .tag { color: #c792ea; }
.code-content .attr { color: #82aaff; }
.code-content .val { color: #c3e88d; }
.code-content .comment { color: #546e7a; }

.cursor {
  color: var(--accent); animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Error Display */
.error-display {
  text-align: center; padding: 2rem;
}
.error-display.hidden { display: none; }
.error-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.error-message {
  color: var(--red); font-size: 0.85rem;
  margin-bottom: 1rem; line-height: 1.5;
}
.btn-retry {
  padding: 0.5rem 1.5rem; border: 1px solid var(--red);
  background: var(--red-dim); color: var(--red);
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-retry:hover { background: rgba(239,68,68,0.2); }

/* ═══ RESULTS PANEL ═══ */
.results-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.validation-card {
  margin-bottom: 1.25rem;
}
.validation-card h3 {
  font-size: 0.85rem; font-weight: 700;
  margin-bottom: 0.75rem; color: var(--text-secondary);
}
.validation-checks {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.v-check {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.8rem;
  opacity: 0; transform: translateX(-10px);
  animation: slideIn 0.3s ease forwards;
}
.v-check.pass { background: var(--green-dim); color: var(--green); }
.v-check.fail { background: var(--red-dim); color: var(--red); }
.v-check .v-icon { font-size: 0.9rem; flex-shrink: 0; }
.v-check .v-name { font-weight: 600; }
.v-check .v-detail { color: var(--text-muted); font-size: 0.72rem; margin-left: auto; }

@keyframes slideIn {
  to { opacity: 1; transform: translateX(0); }
}

.bot-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem; margin-bottom: 1.25rem;
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.6;
}
.bot-summary .summary-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 0.4rem;
}
.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.3rem 2rem;
}
.summary-item { display: flex; justify-content: space-between; }
.summary-item .s-key { color: var(--text-muted); }
.summary-item .s-val { font-weight: 600; color: var(--text-primary); }

/* Action Buttons */
.result-actions {
  display: flex; gap: 0.75rem;
}
.btn-download {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(16,185,129,0.3); }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-rebuild {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.75rem 1.5rem;
  background: var(--bg-surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-rebuild:hover { border-color: var(--border-accent); color: var(--accent); }

/* ═══ CHAT SECTION ═══ */

/* ═══ CLARIFICATION CHAT ═══ */
.clarify-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.clarify-messages {
  display: flex; flex-direction: column; gap: 0.75rem;
  max-height: 400px; overflow-y: auto;
  margin-bottom: 1rem; padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.clarify-messages .chat-msg {
  max-width: 88%; padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word;
}
.clarify-messages .chat-msg.user {
  align-self: flex-end;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border-accent);
}
.clarify-messages .chat-msg.ai {
  align-self: flex-start;
  background: var(--purple-dim); color: var(--text-secondary);
  border: 1px solid rgba(168,85,247,0.15);
}
.clarify-messages .chat-msg.typing {
  align-self: flex-start;
  background: var(--purple-dim); color: var(--text-muted);
  border: 1px solid rgba(168,85,247,0.1);
  font-style: italic;
}
.typing-dots span {
  animation: typingBlink 1.4s infinite both;
  font-size: 1.2rem; letter-spacing: 2px;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.clarify-input-area {
  display: flex; gap: 0.5rem; margin-bottom: 0.75rem; align-items: flex-end;
}
.clarify-input-area textarea {
  flex: 1; background: var(--bg-input);
  border: 1px solid var(--border); color: var(--text-primary);
  padding: 0.6rem 0.9rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.85rem;
  resize: vertical; min-height: 2.4rem; max-height: 8rem;
}
.clarify-input-area textarea:focus { outline: none; border-color: var(--accent); }

.clarify-actions {
  display: flex; justify-content: center; margin: 0.75rem 0;
}
.clarify-actions .btn-build {
  padding: 0.7rem 2rem;
  font-size: 0.9rem;
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(0,210,255,0.2); }
  50% { box-shadow: 0 0 20px rgba(0,210,255,0.5); }
}

.btn-skip-clarify {
  display: block; width: 100%; text-align: center;
  background: none; border: none; color: var(--text-muted);
  font-family: inherit; font-size: 0.75rem;
  padding: 0.5rem; cursor: pointer;
  transition: color 0.2s;
}
.btn-skip-clarify:hover { color: var(--text-secondary); }

.chat-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem; margin-top: 1rem;
}
.chat-section.hidden { display: none; }

.chat-messages {
  display: flex; flex-direction: column; gap: 0.75rem;
  max-height: 300px; overflow-y: auto;
  margin-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.chat-msg {
  max-width: 85%; padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; line-height: 1.55;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border-accent);
}
.chat-msg.ai {
  align-self: flex-start;
  background: var(--purple-dim); color: var(--text-secondary);
  border: 1px solid rgba(168,85,247,0.15);
}

.chat-input-area {
  display: flex; gap: 0.5rem; align-items: flex-end;
}
.chat-input-area textarea {
  flex: 1; background: var(--bg-input);
  border: 1px solid var(--border); color: var(--text-primary);
  padding: 0.55rem 0.85rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.82rem;
  resize: vertical; min-height: 2.4rem; max-height: 8rem;
}
.chat-input-area textarea:focus { outline: none; border-color: var(--accent); }
.btn-send {
  padding: 0.55rem 1.25rem;
  background: var(--accent); color: #000;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-send:hover { background: #00bce0; }

/* ═══ FOOTER ═══ */
.builder-footer {
  text-align: center; padding: 2rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.builder-footer p {
  font-size: 0.78rem; color: var(--text-muted);
}
.builder-footer a { color: var(--accent); text-decoration: none; }

/* ═══ HAMBURGER MENU ═══ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(6, 10, 19, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .nav-links a:last-child { border-bottom: none; }
  .builder-main { padding: 5rem 1rem 2rem; }
  .builder-header h1 { font-size: 1.6rem; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .nav-auth { margin-left: auto; }
  .summary-grid { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .builder-header h1 { font-size: 1.35rem; }
}

/* ═══ UTILITY ═══ */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading shimmer for build button */
.btn-build.loading {
  position: relative; overflow: hidden;
  pointer-events: none;
}
.btn-build.loading::after {
  content: ''; position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer { to { left: 100%; } }

/* ═══ PAYWALL MODAL ═══ */
.paywall-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s ease;
  overflow-y: auto; padding: 1rem;
}
.paywall-overlay.hidden { display: none; }
.paywall-container {
  position: relative; width: 95%; max-width: 960px;
}
.paywall-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: var(--muted); font-size: 1.8rem;
  cursor: pointer; line-height: 1; z-index: 2;
}
.paywall-close:hover { color: #fff; }
.paywall-header {
  text-align: center; margin-bottom: 1.25rem;
}
.paywall-header h2 {
  font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 0.35rem;
}
.paywall-header p {
  color: var(--muted); font-size: 0.9rem;
}
.paywall-free-features {
  background: rgba(255,107,0,0.06); border: 1px solid rgba(255,107,0,0.15);
  border-radius: 12px; padding: 0.75rem 1rem; margin-bottom: 1.25rem;
  text-align: center;
}
.paywall-free-tag {
  font-weight: 700; color: var(--accent); font-size: 0.85rem;
  display: block; margin-bottom: 0.4rem;
}
.paywall-free-list {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem;
  font-size: 0.8rem; color: var(--muted);
}
.paywall-tiers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.tier-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem 1.25rem; position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; transition: transform 0.2s, box-shadow 0.2s;
}
.tier-card:hover {
  transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.tier-popular {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255,107,0,0.15);
}
.tier-premium {
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168,85,247,0.12);
}
.tier-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #e55a00);
  color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 3px 14px; border-radius: 20px; white-space: nowrap;
}
.tier-badge-premium {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}
.tier-name {
  font-size: 1rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.tier-price { margin-bottom: 0.35rem; }
.tier-amount {
  font-size: 2.2rem; font-weight: 800; color: #fff;
}
.tier-popular .tier-amount { color: var(--accent); }
.tier-premium .tier-amount { color: #a855f7; }
.tier-desc {
  font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem;
}
.tier-features {
  list-style: none; padding: 0; margin: 0 0 1.25rem 0;
  text-align: left; width: 100%;
}
.tier-features li {
  font-size: 0.82rem; color: #d1d5db; padding: 0.25rem 0;
}
.btn-tier {
  width: 100%; padding: 0.75rem; border: none; border-radius: 10px;
  background: var(--border); color: #fff; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s; margin-top: auto;
}
.btn-tier:hover { background: #374151; transform: translateY(-1px); }
.btn-tier-popular {
  background: linear-gradient(135deg, var(--accent), #e55a00);
}
.btn-tier-popular:hover { box-shadow: 0 4px 20px rgba(255,107,0,0.4); background: linear-gradient(135deg, #e55a00, var(--accent)); }
.btn-tier-premium {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}
.btn-tier-premium:hover { box-shadow: 0 4px 20px rgba(168,85,247,0.4); background: linear-gradient(135deg, #7c3aed, #a855f7); }
.btn-tier:disabled { opacity: 0.6; pointer-events: none; }
.paywall-note {
  text-align: center; font-size: 0.78rem; color: var(--muted); margin-top: 1rem;
}
.paywall-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.paywall-card h3 {
  font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem;
}
.paywall-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.paywall-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; text-align: center;
}
.paywall-status {
  text-align: center; margin-top: 0.75rem; font-size: 0.85rem; color: var(--accent);
}
.paywall-status.hidden { display: none; }

/* Responsive: stack tiers on mobile */
@media (max-width: 768px) {
  .paywall-tiers { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
  .paywall-container { max-width: 100%; }
  .paywall-free-list { flex-direction: column; gap: 0.3rem; }
}
