:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
  color: #f3f3f3;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; background: #000; }
button, textarea { font: inherit; }
button { color: inherit; }

.shell {
  width: min(48rem, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(.9rem, 2.5vh, 1.5rem) 1rem max(.75rem, env(safe-area-inset-bottom));
}

.chat { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.top-bar { flex: 0 0 auto; }
.menu-placeholder {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: -.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #aaa;
}
.menu-placeholder span {
  width: 1.125rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}
.intro { flex: 0 0 auto; text-align: center; }
.portrait {
  display: block;
  width: min(18rem, 62vw);
  aspect-ratio: 1585 / 992;
  object-fit: cover;
  margin: 0 auto .55rem;
}
.intro h1 { margin: 0; font-size: clamp(1.3rem, 4vw, 1.7rem); letter-spacing: -.03em; }
.intro p { margin: .35rem auto 0; color: #858585; font-size: .86rem; line-height: 1.4; }

.transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: clamp(1.5rem, 5vh, 3.5rem) .15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.transcript::before { content: ""; flex: 1 1 auto; }
.message { flex: 0 0 auto; max-width: 82%; font-size: 1rem; line-height: 1.58; white-space: pre-wrap; }
.message.user { align-self: flex-end; padding: .7rem 1rem; background: #222; border-radius: 1.3rem 1.3rem .35rem 1.3rem; }
.message.assistant { align-self: flex-start; color: #ededed; }
.reply-dots { display: inline-flex; gap: .13em; font-weight: 700; }
.reply-dots > span { animation: reply-dot-bounce 800ms ease-in-out infinite; }
.reply-dots > span:nth-child(2) { animation-delay: 100ms; }
.reply-dots > span:nth-child(3) { animation-delay: 200ms; }
@keyframes reply-dot-bounce {
  0%, 65%, 100% { opacity: .55; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-.22em); }
}
.message-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .4rem; }
.message-links a { color: #dedede; text-underline-offset: .2em; }

.suggestions { flex: 0 0 auto; margin-bottom: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.suggestions button, .quiet-actions button {
  border: 1px solid #2d2d2d;
  background: transparent;
  border-radius: 999px;
  padding: .46rem .7rem;
  color: #9b9b9b;
  font-size: .82rem;
  cursor: pointer;
}
.suggestions button:hover, .quiet-actions button:hover { color: #fff; border-color: #555; }

form { flex: 0 0 auto; position: relative; }
textarea {
  display: block;
  width: 100%;
  min-height: 3.65rem;
  max-height: 9rem;
  resize: none;
  padding: 1.05rem 5.1rem .95rem 1.2rem;
  border: 1px solid #303030;
  border-radius: 1.8rem;
  outline: none;
  background: #171717;
  color: #fff;
}
textarea:focus { border-color: #565656; }
.send { position: absolute; right: .45rem; bottom: .43rem; padding: .66rem .88rem; border: 0; border-radius: 999px; background: #f1f1f1; color: #111; cursor: pointer; }
.quiet-actions { flex: 0 0 auto; height: 1.8rem; display: flex; justify-content: center; align-items: flex-end; }
.quiet-actions button { border: 0; padding: .25rem; color: #5f5f5f; font-size: .72rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-height: 700px) {
  .portrait { width: min(12rem, 42vw); }
  .intro p { display: none; }
  .transcript { padding-top: .8rem; }
}
@media (max-width: 540px) {
  .shell { padding-inline: .75rem; }
  .portrait { width: min(15rem, 58vw); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: reduce) { .reply-dots > span { animation: none; } }
