:root {
  --chat-ink: #19162b;
  --chat-muted: #66627b;
  --chat-paper: #fbf8f4;
  --chat-lilac: #ede7ff;
  --chat-purple: #6952d8;
  --chat-rose: #e16c82;
  --chat-yellow: #f3c95f;
  --chat-line: #dfd8ec;
  --chat-white: #ffffff;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--chat-paper);
  color: var(--chat-ink);
  line-height: 1.6;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 6vw;
  border-bottom: 1px solid var(--chat-line);
  background: rgba(251, 248, 244, 0.94);
  backdrop-filter: blur(16px);
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.chat-brand span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--chat-purple);
}

.chat-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chat-nav a {
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--chat-muted);
  font-weight: 800;
}

.chat-nav a.active,
.chat-nav a:hover {
  color: #ffffff;
  background: var(--chat-purple);
}

.chat-main {
  width: min(1160px, calc(100% - 12vw));
  margin: 0 auto;
}

.chat-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 42px;
  align-items: center;
  padding: 66px 0 50px;
}

.chat-kicker {
  margin: 0 0 10px;
  color: var(--chat-purple);
  font-weight: 900;
  text-transform: uppercase;
}

.chat-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  line-height: 1;
}

.chat-hero p,
.chat-card p,
.chat-panel p,
.bubble p,
.timeline-card p,
.library-card p {
  color: var(--chat-muted);
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid var(--chat-line);
  border-radius: var(--radius);
  background: var(--chat-white);
  font-weight: 900;
  cursor: pointer;
}

.chat-button.primary {
  color: #ffffff;
  border-color: var(--chat-purple);
  background: var(--chat-purple);
}

.phone-mock {
  min-height: 520px;
  padding: 22px;
  border: 1px solid var(--chat-line);
  border-radius: 28px;
  background: var(--chat-white);
  box-shadow: 0 26px 70px rgba(105, 82, 216, 0.18);
}

.phone-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  font-weight: 900;
}

.bubble {
  width: 82%;
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 18px;
  background: var(--chat-lilac);
}

.bubble.right {
  margin-left: auto;
  color: #ffffff;
  background: var(--chat-purple);
}

.bubble.right p {
  color: rgba(255, 255, 255, 0.82);
}

.prompt-card {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--radius);
  background: #fff7da;
}

.chat-section {
  padding: 42px 0;
  border-top: 1px solid var(--chat-line);
}

.chat-section h2 {
  margin: 0 0 20px;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.08;
}

.chat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.chat-card,
.chat-form,
.feed-panel,
.chat-panel,
.timeline-card,
.library-card {
  padding: 22px;
  border: 1px solid var(--chat-line);
  border-radius: var(--radius);
  background: var(--chat-white);
}

.chat-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.chat-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-list li {
  padding: 14px 16px;
  border: 1px solid var(--chat-line);
  border-radius: var(--radius);
  background: #fffefd;
}

.chat-pills,
.library-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chat-pill,
.library-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--chat-line);
  border-radius: 999px;
  background: var(--chat-white);
  color: var(--chat-muted);
  font-weight: 900;
  cursor: pointer;
}

.library-button.active,
.library-button:hover {
  color: #ffffff;
  border-color: var(--chat-purple);
  background: var(--chat-purple);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-item {
  padding: 20px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--chat-purple);
}

.metric-item strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.timeline {
  display: grid;
  gap: 14px;
  counter-reset: chat-step;
}

.timeline-card {
  position: relative;
  padding-left: 66px;
}

.timeline-card::before {
  counter-increment: chat-step;
  content: counter(chat-step);
  position: absolute;
  left: 20px;
  top: 22px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--chat-rose);
  font-weight: 900;
}

.mood-tool {
  display: grid;
  gap: 16px;
}

.mood-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.mood-button {
  min-height: 58px;
  border: 1px solid var(--chat-line);
  border-radius: var(--radius);
  background: var(--chat-white);
  font-weight: 900;
  cursor: pointer;
}

.mood-button.active,
.mood-button:hover {
  color: #ffffff;
  border-color: var(--chat-purple);
  background: var(--chat-purple);
}

.mood-output,
.safety-alert {
  padding: 16px;
  border-radius: var(--radius);
  background: #fff7da;
}

.prototype-frame {
  min-height: 420px;
  display: grid;
  align-content: end;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(25, 22, 43, 0.1), rgba(25, 22, 43, 0.88)),
    url("https://images.unsplash.com/photo-1544027993-37dbfe43562a?auto=format&fit=crop&w=900&q=80") center / cover;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--chat-line);
  border-radius: var(--radius);
  background: var(--chat-white);
}

.chat-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.chat-table th,
.chat-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--chat-line);
  text-align: left;
  vertical-align: top;
}

.chat-table th {
  color: var(--chat-purple);
  background: var(--chat-lilac);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label,
.full-row {
  display: grid;
  gap: 7px;
}

.full-row {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--chat-line);
  border-radius: var(--radius);
  background: #fffefd;
}

textarea {
  min-height: 112px;
}

.message-list {
  display: grid;
  gap: 12px;
}

.message-card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--chat-lilac);
}

.form-status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--chat-purple);
  font-weight: 900;
}

.chat-footer {
  padding: 30px 6vw;
  color: #ffffff;
  background: var(--chat-ink);
}

@media (max-width: 880px) {
  .chat-header,
  .chat-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-main {
    width: calc(100% - 40px);
  }

  .chat-hero,
  .chat-grid,
  .chat-layout,
  .chat-split,
  .metric-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .mood-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-actions {
    display: grid;
  }

  .chat-button {
    width: 100%;
  }
}
