:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #202124;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  background: #1f2933;
  color: #f8fafc;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.sidebar p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.login {
  display: grid;
  gap: 10px;
}

label {
  color: inherit;
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d7dce2;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #202124;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: #3a7bd5;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.16);
}

button,
.file-button {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  background: #3a7bd5;
  color: #fff;
  cursor: pointer;
  text-align: center;
  font-weight: 650;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.session-tools button {
  width: 100%;
  background: #334155;
}

.hidden {
  display: none !important;
}

.chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 100vh;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 30px min(5vw, 64px);
}

.empty {
  margin: auto;
  max-width: 520px;
  color: #667085;
  line-height: 1.65;
  text-align: center;
}

.message {
  max-width: 860px;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #e4e7ec;
  background: #fff;
}

.message.user {
  align-self: flex-end;
  background: #eaf2ff;
  border-color: #caddfb;
}

.message.assistant {
  align-self: flex-start;
}

.meta {
  margin-top: 10px;
  color: #667085;
  font-size: 13px;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 min(5vw, 64px) 12px;
}

.attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid #d7dce2;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #344054;
  font-size: 14px;
}

.attachment button {
  padding: 0 6px;
  background: transparent;
  color: #667085;
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 16px min(5vw, 64px) 22px;
  border-top: 1px solid #e4e7ec;
  background: rgba(246, 247, 249, 0.92);
}

#fileInput {
  display: none;
}

textarea {
  min-height: 48px;
  max-height: 180px;
  resize: vertical;
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    padding: 18px;
  }

  .chat {
    min-height: calc(100vh - 180px);
  }

  .composer {
    grid-template-columns: 1fr auto;
  }

  .file-button {
    grid-column: 1 / 2;
  }

  textarea {
    grid-column: 1 / 3;
  }
}
