:root {
  --bg: #07080d;
  --bg-2: #0d1018;
  --accent: #5ee0b5;
  --accent-2: #8b7cff;
  --text: #eef2f8;
  --muted: #9aa3b8;
  --line: rgba(255, 255, 255, 0.08);
  --font: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

body {
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(94, 224, 181, 0.14), transparent),
    radial-gradient(ellipse 50% 40% at 100% 30%, rgba(139, 124, 255, 0.12), transparent);
}

.page {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.intro .brand {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.15;
}

.intro p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.intro ul {
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.intro a { color: var(--accent-2); }

.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.ghost-btn:hover {
  border-color: rgba(94, 224, 181, 0.4);
  color: var(--accent);
}

.phone {
  width: min(100%, 400px);
  height: min(720px, calc(100vh - 64px));
  background: #0f1320;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  overflow: hidden;
  position: relative;
}

.phone-notch {
  height: 18px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.chat-top {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-top .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07080d;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-top-meta {
  min-width: 0;
  flex: 1;
}

.chat-top strong {
  display: block;
  font-size: 14px;
}

.chat-top span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.reset-chat-btn {
  flex-shrink: 0;
  border: 1px solid rgba(94, 224, 181, 0.35);
  background: rgba(94, 224, 181, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.reset-chat-btn:hover {
  background: rgba(94, 224, 181, 0.16);
  border-color: rgba(94, 224, 181, 0.55);
}

.reset-chat-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.feed {
  overflow: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0b0e16;
}

.bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.bot {
  align-self: flex-start;
  background: #1a2030;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(94, 224, 181, 0.25), rgba(139, 124, 255, 0.28));
  border: 1px solid rgba(94, 224, 181, 0.25);
  border-bottom-right-radius: 4px;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  max-width: 90%;
}

.bubble .meta {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
  background: #0f1320;
}

.composer input {
  border: 1px solid var(--line);
  background: #161b2a;
  color: var(--text);
  border-radius: 999px;
  padding: 12px 14px;
  font: inherit;
}

.composer input:focus {
  outline: 2px solid rgba(94, 224, 181, 0.35);
  border-color: var(--accent);
}

.composer button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #07080d;
  font-size: 16px;
  cursor: pointer;
}

.composer button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lead-flag {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 72px;
  background: rgba(94, 224, 181, 0.95);
  color: #07080d;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hidden { display: none !important; }

.typing {
  align-self: flex-start;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
}

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .intro { order: 2; }
  .phone {
    order: 1;
    height: min(640px, 78vh);
    margin: 0 auto;
  }
}
