* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #172033;
}

.page {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  margin-bottom: 32px;
}

.badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8eefc;
  color: #3157b7;
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: #5b6678;
}

.chat-card {
  background: white;
  border: 1px solid #e4e7ec;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(23, 32, 51, 0.08);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #eef0f4;
}

.chat-header h2 {
  margin: 0;
  font-size: 20px;
}

.chat-header p {
  margin: 6px 0 0;
  color: #778195;
  font-size: 14px;
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #027a48;
  font-size: 13px;
  font-weight: 700;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 28px;
  background: #fbfcfe;
}

.message {
  width: fit-content;
  max-width: min(76ch, 82%);
  padding: 14px 18px;
  border-radius: 18px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.05);
}

.message.assistant {
  align-self: flex-start;
  background: white;
  border: 1px solid #e7ebf0;
  color: #172033;
  border-bottom-left-radius: 6px;
}

.message.user {
  align-self: flex-end;
  max-width: min(58ch, 64%);
  background: #3157b7;
  color: white;
  border-bottom-right-radius: 6px;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 24px 28px 28px;
  border-top: 1px solid #eef0f4;
  background: white;
}

.chat-input textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  padding: 18px 20px;
  font: inherit;
  line-height: 1.5;
  outline: none;
  background: #fbfcfe;
}

.chat-input textarea:focus {
  background: white;
  border-color: #3157b7;
  box-shadow: 0 0 0 4px rgba(49, 87, 183, 0.12);
}

button {
  align-self: end;
  border: none;
  border-radius: 16px;
  padding: 16px 24px;
  background: #172033;
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #26344f;
}

.action-btn {
  width: 100%;
  min-height: 72px;
  border-radius: 12px;
  padding: 14px 18px;
  line-height: 1.2;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

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

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

.action-btn.primary {
  background: #3157b7;
  box-shadow: 0 10px 22px rgba(49, 87, 183, 0.18);
}

.action-btn.primary:hover {
  background: #284a9e;
}

.action-btn.danger {
  background: #b42318;
  box-shadow: 0 10px 22px rgba(180, 35, 24, 0.14);
}

.action-btn.danger:hover {
  background: #912018;
}

.action-btn span {
  display: block;
  font-size: 15px;
}

.action-btn small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 22px;
  padding: 10px 0 2px;
}

.footer-note a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.footer-note a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .page {
    padding: 32px 0;
  }

  .chat-header,
  .chat-body {
    padding-inline: 18px;
  }

  .message,
  .message.user {
    max-width: 88%;
  }

  .chat-input {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
