:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --card: #111827;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-2: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px); background: rgba(7,11,20,.9);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 12px; }
.logo { font-weight: 800; }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 14px; align-items: center; color: var(--muted); flex-wrap: wrap; }
.nav-links a:hover { color: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; padding: 11px 15px; font-weight: 700; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-secondary { background: transparent; border: 1px solid rgba(255,255,255,.12); color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.hero { padding: 64px 0 36px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; letter-spacing: -.03em; margin: 12px 0 14px; }
.hero h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); max-width: 720px; font-size: 1.08rem; }
.badge {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  background: rgba(59,130,246,.12); color: #93c5fd;
  border: 1px solid rgba(59,130,246,.25); font-size: .82rem; font-weight: 600;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.section { padding: 56px 0; }
.section-alt { background: var(--bg-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.card h3 { margin-bottom: 8px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; position: relative; }
.price-card.featured { border-color: rgba(59,130,246,.7); box-shadow: 0 0 0 1px rgba(59,130,246,.28); }
.tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.price { font-size: 2.1rem; font-weight: 800; margin: 10px 0; }
.price span { font-size: .95rem; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; margin: 14px 0 20px; color: var(--muted); }
.price-card li { padding: 6px 0 6px 20px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.credits-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.credit-card { text-align: center; }
.credit-card .pts { font-size: 1.5rem; font-weight: 800; margin: 8px 0; }
.auth-box {
  max-width: 440px; margin: 48px auto; background: var(--card);
  border: 1px solid var(--border); border-radius: 18px; padding: 26px;
}
.form-row { margin: 12px 0; }
.form-row label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.form-row input, .form-row textarea {
  width: 100%; background: #0f172a; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px;
}
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 68px); }
.sidebar { border-right: 1px solid var(--border); background: #0a101c; padding: 18px; }
.balance {
  background: linear-gradient(135deg, rgba(59,130,246,.14), rgba(139,92,246,.1));
  border: 1px solid rgba(59,130,246,.25); border-radius: 14px; padding: 14px; margin-bottom: 16px;
}
.balance .value { font-size: 1.7rem; font-weight: 800; }
.side-nav a { display: block; padding: 9px 11px; border-radius: 10px; color: var(--muted); margin-bottom: 4px; }
.side-nav a.active, .side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.main { display: flex; flex-direction: column; min-height: calc(100vh - 68px); }
.chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.chat-window {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px;
  background: radial-gradient(circle at top, rgba(59,130,246,.07), transparent 42%);
}
.msg {
  max-width: min(740px, 94%); padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); white-space: pre-wrap;
}
.msg.user { align-self: flex-end; background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.3); }
.msg.bot { align-self: flex-start; background: var(--card); }
.msg.system { align-self: center; border: 0; background: transparent; color: var(--muted); font-size: .9rem; }
.composer {
  border-top: 1px solid var(--border); padding: 14px 18px; display: grid;
  grid-template-columns: 1fr auto; gap: 10px; background: #0a101c;
}
.composer textarea {
  min-height: 54px; resize: vertical; max-height: 160px;
  background: #0f172a; color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 12px;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); font-size: .93rem; }
.table th { color: var(--muted); }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fecaca; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); color: #a7f3d0; }
.footer { border-top: 1px solid rgba(255,255,255,.06); padding: 24px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .grid-4, .grid-3, .pricing-grid, .credits-grid { grid-template-columns: 1fr 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2, .pricing-grid, .credits-grid { grid-template-columns: 1fr; }
}
