:root {
  --bg: #0b1020;
  --bg-2: #121a2f;
  --bg-3: #18233d;
  --border: rgba(255,255,255,0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --danger: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 30%),
    var(--bg);
}

body {
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  padding: 32px 0;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--muted);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
}

.hero-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.hero-card {
  padding: 36px;
}

.preview-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.hero-title {
  margin: 18px 0 0;
  font-size: 56px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero-title span {
  display: block;
  background: linear-gradient(90deg, #a78bfa, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  margin-top: 20px;
  max-width: 720px;
  font-size: 18px;
  line-height: 1.9;
  color: #cbd5e1;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: .96;
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-secondary {
  color: white;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

.btn-danger {
  color: white;
  background: var(--danger);
}

.btn-small {
  padding: 10px 16px;
  border-radius: 12px;
}

.stats-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-box {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 18px;
}

.stat-title {
  font-size: 28px;
  font-weight: 800;
}

.stat-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.preview-head {
  margin-bottom: 20px;
}

.preview-title {
  font-size: 18px;
  font-weight: 800;
}

.preview-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.preview-chat {
  flex: 1;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0d1529;
  padding: 18px;
}

.system-box {
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: rgba(124, 58, 237, 0.12);
  color: #ddd6fe;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  margin-bottom: 16px;
}

.message {
  max-width: 85%;
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.message.stranger {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  border-bottom-left-radius: 6px;
}

.message.me {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-bottom-right-radius: 6px;
}

.preview-buttons {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.chat-topbar {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.chat-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-page-title {
  font-size: 28px;
  font-weight: 800;
}

.chat-page-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.sidebar-card {
  padding: 22px;
}

.sidebar-title {
  margin: 0;
  font-size: 20px;
}

.sidebar-text {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.sidebar-buttons {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-box {
  margin-top: 28px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}

.session-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.session-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.session-row strong {
  color: var(--text);
}

.session-row .cyan {
  color: #67e8f9;
}

.chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    min-height: 650px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 18px;
}

.chat-head-title {
  font-size: 20px;
  font-weight: 800;
}

.chat-head-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    scroll-behavior: smooth;
}

.chat-input-row {
  display: flex;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 18px;
}

.chat-input {
  flex: 1;
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  padding: 0 16px;
  color: white;
  outline: none;
}

.chat-input::placeholder {
  color: #64748b;
}

@media (max-width: 960px) {
  .hero-grid,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 42px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .chat-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero-card,
  .preview-card,
  .sidebar-card,
  .chat-card {
    padding: 18px;
  }

  .hero-title {
    font-size: 34px;
  }

  .chat-topbar-left {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-input-row {
    flex-direction: column;
  }

  .chat-input {
    width: 100%;
  }
}
.chat-messages {
  height: 520px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
}

.chat-card {
  max-height: 720px;
}

@media (max-width: 960px) {
  .chat-messages {
    height: 430px;
    max-height: 430px;
  }
}

.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}

.image-viewer img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 14px;
}

.image-viewer {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.88) !important;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important;
  cursor: zoom-out;
}

.image-viewer.is-open {
  display: flex !important;
}

.image-viewer img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 14px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}
.emoji-picker {
  position: absolute;
  bottom: 78px;
  left: 70px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 230px;
  z-index: 50;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.emoji-picker button {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 10px;
  font-size: 20px;
  padding: 8px;
  cursor: pointer;
}