:root {
  color-scheme: light;
  --bg: #f7e7ef;
  --panel: rgba(255, 248, 252, 0.88);
  --panel-border: rgba(54, 33, 44, 0.12);
  --text: #21161d;
  --muted: #6a4d5c;
  --pink: #ef6aa7;
  --pink-deep: #bf3e7d;
  --black: #141114;
  --shadow: 0 30px 80px rgba(30, 15, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 106, 167, 0.28), transparent 34%),
    radial-gradient(circle at top right, rgba(20, 17, 20, 0.18), transparent 28%),
    linear-gradient(180deg, #fff6fa 0%, var(--bg) 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-panel {
  width: min(760px, 100%);
  min-height: min(840px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.hero {
  padding: 28px 28px 18px;
  border-bottom: 1px solid rgba(54, 33, 44, 0.1);
}

.eyebrow,
.message-role,
.status {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pink-deep);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.95;
  max-width: 12ch;
}

.subcopy {
  margin: 14px 0 0;
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.5;
}

.messages {
  padding: 24px 28px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.message {
  max-width: 85%;
  padding: 14px 16px;
  border-radius: 18px;
  animation: slide-up 180ms ease-out;
}

.message.user {
  justify-self: end;
  background: var(--black);
  color: #fff4f8;
  border-bottom-right-radius: 6px;
}

.message.assistant {
  justify-self: start;
  background: rgba(239, 106, 167, 0.16);
  color: var(--text);
  border: 1px solid rgba(239, 106, 167, 0.24);
  border-bottom-left-radius: 6px;
}

.message.notice {
  justify-self: center;
  max-width: 100%;
  background: rgba(20, 17, 20, 0.08);
  color: var(--muted);
  border: 1px dashed rgba(20, 17, 20, 0.14);
}

.message-role {
  margin: 0 0 8px;
  color: inherit;
  opacity: 0.68;
}

.message-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.composer {
  padding: 18px 20px 20px;
  border-top: 1px solid rgba(54, 33, 44, 0.1);
  background: rgba(255, 250, 252, 0.84);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 240px;
  border: 1px solid rgba(54, 33, 44, 0.14);
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
}

textarea:focus {
  outline: 2px solid rgba(239, 106, 167, 0.38);
  border-color: rgba(239, 106, 167, 0.5);
}

.composer-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.status {
  min-height: 1em;
  margin: 0;
  color: var(--muted);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  color: white;
  background: linear-gradient(135deg, var(--pink) 0%, var(--black) 100%);
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes slide-up {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0;
  }

  .chat-panel {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .hero,
  .messages,
  .composer {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    max-width: 9ch;
  }

  .message {
    max-width: 92%;
  }
}
