:root {
  color-scheme: light;
  --ink: #0B1628;
  --text: #465366;
  --muted: #6b7686;
  --line: #E3E8EF;
  --accent: #C89B3C;
  --accent-hover: #B8892F;
  --accent-2: #b84c2f;
  --tech: #1F4E79;
  --bg: #F5F7FA;
  --panel: #FFFFFF;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.chat-shell {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100dvh;
  min-height: 420px;
  background: var(--panel);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-header strong,
.chat-header span {
  display: block;
}

.chat-header span {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}

.call-link,
.send-button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.call-link:hover,
.send-button:hover {
  background: var(--accent-hover);
}

.messages {
  overflow: auto;
  padding: 18px 16px;
}

.message {
  width: fit-content;
  max-width: min(76ch, 86%);
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
  color: var(--text);
}

.message.user {
  margin-left: auto;
  background: #fff8e8;
  border-color: #ead29a;
}

.message.assistant {
  background: #fff;
  border-left: 3px solid var(--tech);
}

.attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  max-width: 100%;
}

.attachment-pill {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: min(280px, 100%);
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.attachment-pill img,
.attachment-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg);
  color: var(--tech);
  font-size: 11px;
  font-weight: 700;
}

.attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-pill button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
}

.chat-shell.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
}

.composer {
  display: grid;
  grid-template-columns: 40px 40px 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  color: var(--tech);
}

textarea {
  width: 100%;
  min-height: 40px;
  max-height: 132px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}

.typing {
  color: var(--muted);
}

.upload-progress {
  height: 4px;
  background: var(--line);
}

.upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .15s ease;
}

@media (max-width: 520px) {
  .chat-header {
    padding: 12px;
  }

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

  .send-button {
    grid-column: 1 / -1;
  }
}
