:root {
  --bg: #f7fbff;
  --white: #fff;
  --ink: #061843;
  --muted: #61708f;
  --line: #dce7f5;
  --soft: #eef6ff;
  --blue: #075fff;
  --blue-2: #0ea5e9;
  --cyan: #22d3ee;
  --violet: #7c3aed;
  --green: #16a34a;
  --red: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 22px 60px rgba(6, 24, 67, .12);
  --shadow-sm: 0 10px 28px rgba(6, 24, 67, .1);
  --radius: 18px;
  --radius-sm: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #f8fcff 0%, #f4f9ff 52%, #eef6ff 100%);
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
.bot-field { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px !important; height: 1px !important; opacity: 0 !important; overflow: hidden !important; pointer-events: none !important; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.page-shell {
  width: min(1540px, calc(100% - 16px));
  margin: 8px auto;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 42px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; color: var(--blue); font-size: 28px; letter-spacing: 1px; }
.brand img { width: 42px; height: 42px; }
.nav { display: flex; align-items: center; gap: 34px; color: #1f2c4f; font-size: 14px; font-weight: 650; }
.nav a:hover { color: var(--blue); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--blue);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(7, 95, 255, .22);
}
.btn:hover { transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn-soft { background: var(--soft); color: var(--blue); border-color: #d7e8ff; box-shadow: none; }
.btn-danger { background: var(--red); box-shadow: none; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.hero {
  min-height: 690px;
  display: grid;
  grid-template-columns: 1fr 560px;
  gap: 38px;
  padding: 48px 52px 30px;
  position: relative;
}
.hero-copy h1 {
  margin: 30px 0 24px;
  max-width: 690px;
  font-size: clamp(44px, 5vw, 78px);
  line-height: .98;
  letter-spacing: 0;
}
.hero-copy p {
  max-width: 570px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 18px; margin-top: 32px; flex-wrap: wrap; }
.hero-visual { position: relative; min-height: 520px; }
.hero-arc {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 60% 28%, rgba(34,211,238,.15), transparent 30%),
    linear-gradient(135deg, transparent 0 45%, rgba(220,236,255,.55) 45% 62%, transparent 62%);
  border-radius: 28px;
}
.mascot-hero {
  position: absolute;
  left: 30px;
  top: 54px;
  width: 350px;
  height: 350px;
  object-fit: cover;
  object-position: 4% 52%;
  filter: drop-shadow(0 24px 30px rgba(6,24,67,.14));
}
.mascot-small-crop {
  width: 78px;
  height: 78px;
  object-fit: cover;
  object-position: 93% 52%;
  border-radius: 24px;
}
.mascot-card-crop {
  width: 135px;
  height: 135px;
  object-fit: cover;
  object-position: 93% 52%;
}
.chat-preview {
  position: absolute;
  right: 2px;
  top: 176px;
  width: 305px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid #d8e6f8;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
}
.chat-head img { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 2px; }
.chat-head strong { display: block; font-size: 14px; }
.chat-head span { display: block; font-size: 11px; opacity: .85; }
.chat-body { padding: 16px; display: grid; gap: 12px; background: #fbfdff; scroll-behavior: smooth; }
.msg {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.msg.bot { background: #eef2f7; color: #1d2b4f; border-bottom-left-radius: 5px; }
.msg.user { background: var(--blue); color: #fff; margin-left: auto; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.typing-text, .typing-live .typing-tail { white-space: pre-wrap; }
.typing { color: #7a86a0; font-size: 12px; }
.typing-bubble {
  width: fit-content;
  max-width: 74px;
  display: flex;
  gap: 5px;
  padding: 12px 13px;
  border-radius: 14px;
  border-bottom-left-radius: 5px;
  background: #eef2f7;
}
.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a86a0;
  animation: ainaTypingDots 1.05s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: .16s; }
.typing-bubble span:nth-child(3) { animation-delay: .32s; }
@keyframes ainaTypingDots {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.markdown p { margin: 0 0 .65em; }
.markdown p:last-child { margin-bottom: 0; }
.markdown ul, .markdown ol { margin: .25em 0 .75em; padding-left: 1.35em; }
.markdown li { margin: .18em 0; }
.markdown strong { font-weight: 800; }
.markdown em { font-style: italic; }
.markdown code { font: 12px/1.35 Consolas, Monaco, monospace; background: rgba(6,24,67,.08); padding: 2px 4px; border-radius: 5px; }
.markdown pre { margin: .35em 0 .75em; max-width: 100%; overflow: auto; background: #111827; color: #f8fafc; border-radius: 10px; padding: 10px; }
.markdown pre code { background: transparent; color: inherit; padding: 0; }
.markdown h1, .markdown h2, .markdown h3 { font-size: 1em; line-height: 1.3; margin: .25em 0 .45em; }
.markdown blockquote { margin: .35em 0; padding: .1em 0 .1em .75em; border-left: 3px solid #c7d7eb; color: #334155; }
.markdown a { color: var(--blue); font-weight: 750; text-decoration: underline; }
.markdown hr { border: 0; border-top: 1px solid #c7d7eb; margin: .65em 0; }
.markdown table { width: 100%; border-collapse: collapse; margin: .45em 0 .75em; font-size: 12px; }
.markdown th, .markdown td { border: 1px solid #c7d7eb; padding: 5px 6px; text-align: left; vertical-align: top; }
.markdown th { background: rgba(7,95,255,.07); font-weight: 800; }
.chat-input { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #7a86a0; font-size: 12px; }
.proof-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 680px;
  margin-top: 68px;
}
.proof-item { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: start; }
.proof-icon {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--soft); color: var(--blue); font-weight: 900;
}
.proof-item h3 { margin: 0 0 7px; color: var(--blue); font-size: 15px; }
.proof-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.section { padding: 38px 52px; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(6,24,67,.06);
}
.how-panel { padding: 38px; }
.section-title { text-align: center; margin: 0 0 34px; font-size: 30px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; align-items: start; }
.step { position: relative; padding: 6px 4px; }
.step-number { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; margin-right: 8px; }
.step-icon { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%; background: #f1f7ff; color: var(--blue); font-size: 26px; margin-bottom: 20px; }
.step h3 { margin: 0 0 10px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card { padding: 20px; min-height: 150px; }
.feature-card h3 { margin: 8px 0; font-size: 17px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.aina-guide {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #cfe3ff;
  background: linear-gradient(135deg, #f0f7ff, #fff);
}
.aina-guide.admin { background: #f8fafc; border-color: #e2e8f0; }
.aina-guide img { flex: 0 0 auto; }
.aina-bubble {
  position: relative;
  color: #244064;
  line-height: 1.55;
}
.aina-bubble strong { display: block; color: var(--blue); margin-bottom: 3px; }
.help-dot {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid #b9cdf0;
  color: var(--blue);
  background: #f4f9ff;
  font-size: 12px;
  font-weight: 900;
  cursor: help;
  position: relative;
}
.help-dot[data-help]:hover::after, .help-dot[data-help]:focus::after {
  content: attr(data-help);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(280px, 80vw);
  padding: 12px 14px;
  border-radius: 10px;
  background: #061843;
  color: #fff;
  font-weight: 500;
  line-height: 1.45;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.mock-code {
  background: #f4f7fb;
  border: 1px solid #e2eaf5;
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
  color: #18315d;
  font-size: 13px;
  line-height: 1.6;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 52px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.cookie-consent {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: none;
}
.cookie-card {
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.cookie-card img { width: 54px; height: 54px; }
.cookie-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.cookie-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-side { padding: 42px; }
.auth-side h1 { font-size: 42px; line-height: 1.08; margin: 22px 0 14px; }
.auth-side p { color: var(--muted); line-height: 1.6; }
.auth-visual { background: linear-gradient(135deg, #f1f8ff, #fff); padding: 42px; display: grid; align-content: center; gap: 22px; }
.form-grid { display: grid; gap: 15px; }
.field label { display: flex; align-items: center; gap: 7px; font-weight: 750; margin-bottom: 8px; font-size: 14px; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d6e3f3;
  border-radius: 10px;
  background: #fff;
  padding: 11px 13px;
  color: var(--ink);
  outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(7,95,255,.08); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; color: #3f4e70; line-height: 1.45; font-size: 14px; }
.checkbox input { margin-top: 4px; }
.flash { padding: 13px 15px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash.success { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.flash.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.app-shell {
  min-height: calc(100vh - 16px);
  display: grid;
  grid-template-columns: 260px 1fr;
}
.app-sidebar {
  padding: 26px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.72);
}
.app-nav { display: grid; gap: 8px; margin-top: 28px; }
.app-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: #263756;
  font-weight: 700;
}
.app-nav a.active, .app-nav a:hover { background: #eef6ff; color: var(--blue); }
.app-main { padding: 28px; }
.app-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.breadcrumb { color: var(--muted); font-size: 14px; }
.status-saved { color: var(--green); font-size: 14px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.metric { padding: 20px; }
.metric strong { display: block; font-size: 32px; color: var(--blue); }
.metric span { color: var(--muted); font-size: 14px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 16px; align-items: start; }
.wizard-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 17px 20px;
}
.wizard-step { display: flex; align-items: center; gap: 10px; color: #8793a8; font-weight: 750; font-size: 14px; }
.wizard-step b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e8eef8; color: #7a86a0; }
.wizard-step.active { color: var(--ink); }
.wizard-step.active b { background: var(--blue); color: #fff; }
.editor-card { padding: 24px; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.preview-panel { padding: 24px; position: sticky; top: 18px; }
.widget-theme-row { display: flex; gap: 10px; margin: 12px 0 24px; }
.theme-choice { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; color: #fff; cursor: pointer; }
.mini-widget { width: 100%; max-width: 310px; margin: 0 auto; position: relative; }
.mini-bubble { width: 58px; height: 58px; display: grid; place-items: center; margin: 16px 0 0 auto; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 12px 28px rgba(7,95,255,.28); }
.embed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: #53617e; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eef6ff; color: var(--blue); font-weight: 800; font-size: 12px; }
.impersonation-bar {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.admin-shell { min-height: calc(100vh - 16px); display: grid; grid-template-columns: 280px 1fr; background: #f8fafc; }
.admin-sidebar { background: #07142e; color: #dbeafe; padding: 24px; }
.admin-sidebar .brand { color: #fff; }
.admin-nav { display: grid; gap: 4px; margin-top: 28px; }
.admin-nav a { padding: 11px 12px; border-radius: 8px; color: #dbeafe; font-weight: 700; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.1); }
.admin-main { padding: 28px; }
.admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; box-shadow: 0 8px 18px rgba(15,23,42,.05); }

@media (max-width: 1050px) {
  .hero, .auth-card, .editor-grid, .app-shell, .admin-shell { grid-template-columns: 1fr; }
  .app-sidebar, .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .proof-row, .steps, .feature-grid, .dashboard-grid, .embed-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 32px 24px; }
  .topbar { padding: 0 22px; }
  .nav { display: none; }
}
@media (max-width: 640px) {
  .container { width: min(100% - 24px, 1180px); }
  .page-shell { width: calc(100% - 8px); margin: 4px auto; border-radius: 14px; }
  .hero-copy h1 { font-size: 42px; }
  .hero-visual { min-height: 500px; }
  .mascot-hero { width: 250px; height: 250px; left: 0; }
  .chat-preview { top: 230px; right: 0; width: min(100%, 300px); }
  .proof-row, .steps, .feature-grid, .dashboard-grid, .form-two, .embed-grid { grid-template-columns: 1fr; }
  .section { padding: 26px 18px; }
  .footer, .cookie-card { flex-direction: column; align-items: flex-start; }
}
