:root {
  color-scheme: dark;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #050505;
  color: #f5f5f2;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  background: #050505;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgba(255, 255, 255, 0.035) 50%, transparent 50.1%),
    #050505;
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 960px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 52px);
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto auto;
  gap: 0;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f5f5f2;
}

.eyebrow,
.message__role,
.disclosure p:first-child,
.composer label,
.status-mark,
footer {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 6vw, 58px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.status-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 4px;
  color: #bdbdb7;
}

.status-mark span {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.disclosure {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid #343431;
}

.disclosure p {
  margin: 0;
  color: #bdbdb7;
  font-size: 12px;
  line-height: 1.55;
}

.disclosure p:first-child {
  color: #f5f5f2;
}

.conversation {
  min-height: 280px;
  max-height: 54vh;
  overflow-y: auto;
  padding: 20px 0;
  scrollbar-color: #6e6e68 transparent;
}

.message {
  width: min(88%, 720px);
  margin: 0 0 18px;
  padding: 15px 17px;
  border: 1px solid #393936;
  background: #0a0a0a;
}

.message--user {
  margin-left: auto;
  border-color: #f5f5f2;
  background: #f5f5f2;
  color: #050505;
}

.message--error {
  border-style: dashed;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.65;
}

.message .message__role {
  margin-bottom: 8px;
  color: #8f8f89;
}

.message--user .message__role {
  color: #4b4b47;
}

.composer {
  padding-top: 18px;
  border-top: 1px solid #f5f5f2;
}

.composer label {
  display: block;
  margin-bottom: 8px;
  color: #bdbdb7;
}

textarea {
  display: block;
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #555550;
  border-radius: 0;
  outline: 0;
  background: #050505;
  color: #f5f5f2;
  font-size: 15px;
  line-height: 1.55;
}

textarea::placeholder {
  color: #696965;
}

textarea:focus {
  border-color: #f5f5f2;
  box-shadow: 0 0 0 1px #f5f5f2;
}

.composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
}

.composer__footer > p,
.request-status {
  margin: 0;
  color: #8f8f89;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.5;
}

.composer__actions {
  display: flex;
  gap: 8px;
}

.button {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid #f5f5f2;
  border-radius: 0;
  background: #f5f5f2;
  color: #050505;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.button--quiet {
  background: transparent;
  color: #f5f5f2;
}

.button:hover:not(:disabled),
.button:focus-visible {
  outline: 2px solid #f5f5f2;
  outline-offset: 3px;
}

.button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.request-status {
  min-height: 15px;
  margin-top: 8px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #343431;
  color: #6f6f6a;
}

@media (max-width: 600px) {
  .shell {
    padding: 18px;
  }

  .masthead,
  .composer__footer,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-mark {
    padding-top: 0;
  }

  .disclosure {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .conversation {
    max-height: none;
  }

  .message {
    width: 94%;
  }

  .composer__footer {
    gap: 10px;
  }

  .composer__actions,
  .button {
    width: 100%;
  }

  footer {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

