:root {
  --bg: #090b10;
  --bg2: #0f1219;
  --bg3: #181d28;
  --surface: #1f2533;
  --border: #2a3040;
  --text: #e4e8f0;
  --text2: #8892a8;
  --text3: #5a6478;
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.12);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; border: none; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); }
.btn-ghost { background: none; color: var(--text2); border: none; }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.landing-nav { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background: rgba(9, 11, 16, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.landing-nav .logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.landing-nav .logo span { color: var(--accent); }

.hero { text-align: center; padding: 100px 24px 60px; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; line-height: 1.1; margin-bottom: 20px; background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 40%, #93c5fd 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 18px; color: var(--text2); max-width: 600px; margin: 0 auto 32px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.demo-window { max-width: 700px; margin: 48px auto 0; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-align: left; }
.demo-dots { display: flex; gap: 6px; padding: 12px 16px; background: var(--bg3); }
.demo-dots span { width: 10px; height: 10px; border-radius: 50%; }
.demo-dots span:nth-child(1) { background: #ef4444; }
.demo-dots span:nth-child(2) { background: #f59e0b; }
.demo-dots span:nth-child(3) { background: #22c55e; }
.demo-content { padding: 24px; font-size: 14px; line-height: 1.8; font-family: 'JetBrains Mono', monospace; }
.demo-content .section-num { color: var(--accent); font-weight: 600; }
.demo-content .section-title { color: var(--text); font-weight: 600; }
.demo-content .control-ref { color: var(--accent2); font-size: 12px; }

.frameworks { padding: 60px 24px; text-align: center; }
.frameworks h2 { font-size: 24px; margin-bottom: 24px; color: var(--text2); }
.framework-logos { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.framework-logos span { padding: 12px 24px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; color: var(--text2); }

.features { padding: 80px 24px; max-width: 1000px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 32px; margin-bottom: 12px; }
.features > p { text-align: center; color: var(--text2); margin-bottom: 48px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color 0.2s; }
.feature-card:hover { border-color: var(--accent); }
.feature-card .icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-glow); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--text2); font-size: 14px; line-height: 1.6; }

.pricing { padding: 80px 24px; max-width: 1000px; margin: 0 auto; }
.pricing h2 { text-align: center; font-size: 32px; margin-bottom: 8px; }
.pricing > p { text-align: center; color: var(--text2); margin-bottom: 48px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.price-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 30px var(--accent-glow); position: relative; }
.price-card.featured::before { content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 16px; border-radius: 20px; }
.price-card h3 { font-size: 20px; margin-bottom: 8px; }
.price-card .amount { font-size: 48px; font-weight: 800; }
.price-card .amount span { font-size: 18px; font-weight: 400; color: var(--text2); }
.price-card .period { color: var(--text3); font-size: 14px; margin-bottom: 24px; }
.price-card ul { list-style: none; margin-bottom: 28px; }
.price-card li { padding: 8px 0; color: var(--text2); font-size: 14px; }
.price-card li::before { content: '✔'; color: var(--accent); margin-right: 10px; }
.price-card .btn { width: 100%; }

.footer { text-align: center; padding: 40px 24px; border-top: 1px solid var(--border); color: var(--text3); font-size: 13px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 400px; }
.modal h2 { margin-bottom: 24px; text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-group input { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; }
.form-group input:focus { outline: none; border-color: var(--accent); }
.error { background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); padding: 10px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text3); }

.app-layout { display: grid; grid-template-columns: 260px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.app-layout[hidden] { display: none; }
.app-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.app-header .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.app-header .logo span { color: var(--accent); }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.plan-badge { background: var(--bg3); color: var(--text2); padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.plan-badge.pro { background: var(--accent-glow); color: var(--accent); }

.sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidebar-section { margin-bottom: 12px; }
.sidebar-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 8px; }
.mode-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: none; border: none; border-radius: var(--radius-sm); color: var(--text2); font-size: 13px; text-align: left; transition: all 0.15s; }
.mode-btn:hover { background: var(--bg3); color: var(--text); }
.mode-btn.active { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.mode-btn .icon { font-size: 16px; width: 20px; text-align: center; }
.convo-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12px; color: var(--text2); cursor: pointer; transition: background 0.15s; }
.convo-item:hover { background: var(--bg3); }
.convo-item.active { background: var(--accent-glow); color: var(--accent); }
.convo-item .preview { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-item .del { background: none; border: none; color: var(--text3); font-size: 12px; opacity: 0; transition: opacity 0.15s; }
.convo-item:hover .del { opacity: 1; }
.quota-bar { font-size: 12px; color: var(--text3); }
.quota-fill { width: 100%; height: 4px; background: var(--bg); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.quota-fill-inner { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }

.main-area { display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.context-bar { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--bg2); border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.context-bar label { color: var(--text3); font-weight: 500; }
.context-bar input, .context-bar select { padding: 5px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; }
.context-bar input:focus, .context-bar select:focus { outline: none; border-color: var(--accent); }

.chat-messages { flex: 1; overflow-y: auto; padding: 24px; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text2); font-size: 14px; max-width: 500px; margin: 0 auto 24px; }
.example-prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; max-width: 600px; margin: 0 auto; }
.example-prompt { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; color: var(--text2); cursor: pointer; text-align: left; transition: all 0.15s; }
.example-prompt:hover { border-color: var(--accent); color: var(--text); }

.message { margin-bottom: 20px; }
.message .bubble { max-width: 85%; padding: 14px 18px; border-radius: var(--radius); font-size: 14px; line-height: 1.7; }
.message.user .bubble { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.message.assistant .bubble { background: var(--bg2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message .meta { font-size: 11px; color: var(--text3); margin-top: 4px; }
.message.user .meta { text-align: right; }
.message.assistant pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin: 10px 0; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.message.assistant code { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.message.assistant :not(pre) > code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 4px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; }
.copy-btn:hover { background: var(--surface); }

.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }
.typing-indicator span { width: 6px; height: 6px; background: var(--text3); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.chat-input-area { padding: 16px 20px; background: var(--bg2); border-top: 1px solid var(--border); }
.input-wrapper { display: flex; gap: 10px; align-items: flex-end; max-width: 800px; margin: 0 auto; }
.chat-textarea { flex: 1; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; resize: none; line-height: 1.5; max-height: 200px; }
.chat-textarea:focus { outline: none; border-color: var(--accent); }
.send-btn { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--accent); border: none; color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-btn:hover { background: var(--accent2); }

@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero h1 { font-size: 32px; }
  .pricing-grid, .features-grid { grid-template-columns: 1fr; }
}
