:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20232b;
  background: #f5f6f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --accent: #5356d8;
  --border: #e4e6eb;
  --muted: #777d8a;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
textarea {
  font: inherit;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #22242b;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.brand-mark,
.welcome-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 15px;
}

.brand-light {
  color: var(--muted);
  font-weight: 500;
}

.status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #545a66;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36a875;
}

.conversation {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: min(100%, 760px);
  margin: 0 auto;
}

.welcome {
  margin: auto 0;
  padding: 56px 0;
  text-align: center;
}

.welcome-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  border-radius: 15px;
  font-size: 23px;
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 650;
  letter-spacing: -1.6px;
}

.welcome-copy {
  max-width: 470px;
  margin: 15px auto 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.suggestion {
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #545a66;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 120ms, color 120ms;
}

.suggestion:hover {
  border-color: #b7b9ef;
  color: var(--accent);
}

.messages {
  display: none;
  flex-direction: column;
  gap: 22px;
  padding: 36px 0;
}

.messages.visible {
  display: flex;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 100%;
}

.message.user {
  justify-content: flex-end;
}

.message-content {
  max-width: min(82%, 620px);
  padding: 13px 16px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.user .message-content {
  border-bottom-right-radius: 5px;
  color: #fff;
  background: var(--accent);
}

.message.assistant .message-content {
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  background: #fff;
}

.message.assistant.pending .message-content {
  color: var(--muted);
}

.composer {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 13px 14px 10px 18px;
  border: 1px solid #dfe1e7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 20px rgb(34 39 54 / 5%);
}

.composer:focus-within {
  border-color: #b7b9ef;
  box-shadow: 0 0 0 3px rgb(83 86 216 / 8%);
}

textarea {
  display: block;
  width: 100%;
  max-height: 180px;
  min-height: 32px;
  padding: 5px 0;
  resize: none;
  border: 0;
  outline: 0;
  color: #20232b;
  background: transparent;
  font-size: 14px;
  line-height: 1.55;
}

textarea::placeholder {
  color: #989daa;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.privacy-note,
.disclaimer {
  color: #9297a3;
  font-size: 11px;
}

.send-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.send-button:disabled {
  background: #a7a9e8;
  cursor: wait;
}

.send-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.disclaimer {
  margin: 11px auto 17px;
  text-align: center;
}

.auth-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: #20232b;
  box-shadow: 0 18px 60px rgb(34 39 54 / 22%);
}

.auth-dialog::backdrop {
  background: rgb(29 32 43 / 42%);
  backdrop-filter: blur(3px);
}

.auth-form {
  padding: 27px;
}

.auth-form h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.auth-copy {
  margin: 9px 0 23px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline-color: var(--accent);
}

.auth-error {
  min-height: 16px;
  margin: 7px 0 0;
  color: #b42318;
  font-size: 12px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

.auth-actions button {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
}

.auth-cancel {
  color: #545a66;
  background: #fff;
}

.auth-submit {
  border-color: var(--accent) !important;
  color: #fff;
  background: var(--accent);
}

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

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

  .topbar {
    height: 62px;
  }

  .welcome {
    padding: 40px 0;
  }

  .privacy-note {
    max-width: 230px;
    line-height: 1.35;
  }
}
