:root {
  --bg: #07080c;
  --bg-elev: #10121a;
  --bg-soft: #161924;
  --line: rgba(255,255,255,.08);
  --text: #f4f1ea;
  --muted: #9aa3b5;
  --rose: #e11d48;
  --amber: #f59e0b;
  --ok: #34d399;
  --warn: #fbbf24;
  --info: #60a5fa;
  --shadow: 0 30px 80px rgba(0,0,0,.45);
  --radius: 18px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.landing-wrap { overflow-x: hidden; }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 7vw; position: sticky; top: 0; z-index: 20;
  background: linear-gradient(#07080cee, #07080c88 70%, transparent);
  backdrop-filter: blur(16px);
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 650; letter-spacing: .02em; }
.mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, #fda4af, var(--rose) 45%, #7f1d1d);
  box-shadow: 0 0 0 1px #fff2, 0 8px 24px #e11d4866;
}
.nav-links { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
.btn {
  border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 600;
  background: var(--text); color: #111;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.rose { background: var(--rose); color: white; }
.btn.tiny { padding: 7px 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger:hover { border-color: #e11d48; color: #fda4af; }

.hero { padding: 48px 7vw 24px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.kicker { color: var(--amber); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { font-family: var(--display); font-size: clamp(42px, 6vw, 76px); line-height: .95; letter-spacing: -.03em; margin: 14px 0 18px; }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 520px; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-card {
  background: linear-gradient(180deg, #1a1d27, #0d0f16);
  border: 1px solid var(--line); border-radius: 28px; padding: 18px; box-shadow: var(--shadow);
}
.fake-site { height: 340px; border-radius: 18px; background: #0b0d13; position: relative; overflow: hidden; border: 1px solid var(--line); }
.fake-site .bar { height: 36px; background: #141824; display: flex; align-items: center; gap: 6px; padding: 0 12px; color: #445; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: #333; }
.bubble {
  position: absolute; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 20px;
  background: var(--rose); display: grid; place-items: center; box-shadow: 0 12px 30px #e11d4866;
}
.panel {
  position: absolute; right: 18px; bottom: 86px; width: 280px; height: 220px;
  background: #12141c; border: 1px solid var(--line); border-radius: 18px; padding: 14px;
}
.msg { font-size: 12px; background: #1c2030; padding: 8px 10px; border-radius: 10px; margin-bottom: 8px; color: #d7dbe7; }
.msg.me { background: #e11d48; color: white; margin-left: 40px; }

.section { padding: 72px 7vw; }
.section h2 { font-family: var(--display); font-size: 36px; letter-spacing: -.02em; margin-bottom: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.snippet {
  margin-top: 28px; background: #0b0d13; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: #f4d0c0;
  overflow-x: auto; white-space: pre-wrap;
}
footer.landing { padding: 28px 7vw 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.login-card { width: min(420px, 100%); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.login-card h1 { font-family: var(--display); font-size: 32px; margin: 12px 0 8px; }
.provider { width: 100%; margin-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.mobile-bar { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.side {
  border-right: 1px solid var(--line); padding: 20px 16px; background: #0b0d13;
  display: flex; flex-direction: column; gap: 18px;
}
.side nav a, .side nav button {
  display: flex; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--muted); padding: 9px 10px; border-radius: 10px; font-size: 14px;
}
.side nav a.active, .side nav a:hover, .side nav button:hover { background: var(--bg-soft); color: var(--text); }
.main { padding: 24px 28px 80px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.page-title { font-family: var(--display); font-size: 32px; letter-spacing: -.02em; }
.userpill { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.userpill img { width: 28px; height: 28px; border-radius: 99px; object-fit: cover; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-fields { display: flex; gap: 8px; }
.inline-fields input { flex: 1; }

.bots { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bot-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bot-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); }
.status.deployed, .status.ready { color: var(--ok); border-color: #34d39944; }
.status.training, .status.processing, .status.pending { color: var(--warn); }
.status.draft { color: var(--muted); }
.status.error { color: var(--rose); }
.meta { color: var(--muted); font-size: 13px; }

.editor { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 6px 12px; }
.tabs button.on { background: var(--text); color: #111; }
label.field { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], input[type="url"], input[type="color"], textarea, select {
  width: 100%; background: #0b0d13; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 8px 0; }
.preview-frame {
  height: 640px; border-radius: 24px; border: 1px solid var(--line); background:
    radial-gradient(circle at top right, #1c2233, #0b0d13);
  position: relative; overflow: hidden;
}
.avatar-preview { width: 48px; height: 48px; border-radius: 14px; margin: 8px 0; object-fit: cover; }
.doc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.doc { background: #0b0d13; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.hidden { display: none !important; }
.flash { background: #1b2436; border: 1px solid #334; color: #c9d4ea; padding: 10px 12px; border-radius: 12px; margin: 10px 0; font-size: 13px; }
.empty { color: var(--muted); padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; display: grid; gap: 10px; justify-items: center; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #0b0d13; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat strong { font-size: 22px; display: block; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; margin-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar-col .bar { width: 100%; background: linear-gradient(#fb7185, #e11d48); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-col span { font-size: 10px; color: var(--muted); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c2030; border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 40;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #e11d4866; }

.hosted-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(circle at 20% 0%, #3f0d1c55, transparent 40%), var(--bg); }

@media (max-width: 960px) {
  .hero, .editor, .app-shell, .grid3, .stat-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .mobile-bar { display: flex; }
  .side {
    display: none; position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 30;
    box-shadow: var(--shadow);
  }
  .side.open { display: flex; }
  .preview-frame { height: 520px; }
}
