:root {
  color-scheme: light;
  --bg: #f4efe5;
  --bg-accent: #eadfcb;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffaf1;
  --border: rgba(72, 49, 28, 0.14);
  --text: #20160f;
  --muted: #6f5d4f;
  --brand: #a64b2a;
  --brand-strong: #86361a;
  --assistant: #f2e5d3;
  --user: #25180f;
  --user-text: #fff8ef;
  --shadow: 0 30px 80px rgba(56, 34, 19, 0.16);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #f7f2ea 50%, var(--bg-accent) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.page-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 40px 20px 32px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--brand);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 0.96;
  max-width: 10ch;
}

.hero-copy {
  max-width: 56ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  min-height: 72vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 249, 239, 0.9);
}

.toolbar-label,
.message-role {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.status-text {
  margin: 0;
  font-size: 0.96rem;
}

.ghost-button,
.send-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    background-color 140ms ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

.send-button {
  background: var(--brand);
  color: #fff7f2;
  min-width: 88px;
}

.ghost-button:hover,
.send-button:hover {
  transform: translateY(-1px);
}

.ghost-button:disabled,
.send-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.message-list {
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: min(80%, 720px);
  padding: 16px 18px;
  border-radius: 22px;
  line-height: 1.5;
  animation: rise-in 220ms ease;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.assistant {
  background: var(--assistant);
  border-top-left-radius: 8px;
  align-self: flex-start;
}

.message.user {
  background: var(--user);
  color: var(--user-text);
  border-top-right-radius: 8px;
  align-self: flex-end;
}

.message.user .message-role {
  color: rgba(255, 248, 239, 0.72);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-strong);
}

.composer textarea {
  width: 100%;
  resize: none;
  max-height: 180px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fffdf9;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  outline: none;
}

.composer textarea:focus {
  border-color: rgba(166, 75, 42, 0.42);
  box-shadow: 0 0 0 4px rgba(166, 75, 42, 0.12);
}

.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 rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

@media (max-width: 760px) {
  .page-shell {
    padding: 24px 12px 16px;
  }

  .app-card {
    min-height: 78vh;
  }

  .toolbar,
  .composer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .message {
    max-width: 100%;
  }

  .send-button,
  .ghost-button {
    width: 100%;
  }
}

