:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #17181c;
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100svh;
}

.chat {
  width: min(740px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: clamp(100px, 30svh, 300px);
  padding-bottom: 64px;
}

h1 {
  margin: 0 0 34px;
  text-align: center;
  font-size: clamp(2.75rem, 7vw, 3.8rem);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.065em;
}

.composer {
  padding: 22px 22px 16px;
  background: #f7f8fa;
  border: 1px solid #e8e9ed;
  border-radius: 25px;
  box-shadow: 0 4px 24px #18202b04;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: #c7cbd3;
  box-shadow: 0 0 0 3px #20253604, 0 4px 24px #18202b04;
}

textarea {
  display: block;
  width: 100%;
  min-height: 66px;
  max-height: 240px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: none;
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.6;
  color: #22252b;
  background: transparent;
  overflow-y: auto;
}

textarea::placeholder {
  color: #9398a3;
  opacity: .78;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

button {
  min-height: 40px;
  padding: 0 19px;
  border: 0;
  border-radius: 12px;
  background: #24262c;
  color: #fff;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

button:hover:enabled { background: #090a0d; }
button:active:enabled { transform: scale(.97); }
button:disabled { background: #e5e7ec; color: #a0a5af; cursor: default; }
button:focus-visible { outline: 3px solid #929eb5; outline-offset: 3px; }

.reply-region { margin: 24px 8px 0; }

.reply {
  margin: 0;
  color: #555c68;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .chat { width: calc(100% - 32px); padding-top: 25svh; }
  h1 { margin-bottom: 28px; }
  .composer { padding: 18px 18px 14px; border-radius: 22px; }
  textarea { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
