:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --line: #d9e2dd;
  --text: #16231d;
  --muted: #596b61;
  --green: #1f9d67;
  --blue: #2364aa;
  --purple: #7251c7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
select,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfdfc;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
}

.brand p,
.chat-head p,
.install p {
  color: var(--muted);
  font-size: 14px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.row strong {
  color: var(--text);
  text-align: right;
}

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

.actions .primary {
  grid-column: 1 / -1;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button.primary,
.send {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

.login form {
  display: grid;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

pre {
  max-height: 220px;
  overflow: auto;
  background: #111b17;
  color: #d4f3e4;
  padding: 12px;
  white-space: pre-wrap;
}

.install-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

details {
  color: var(--muted);
  font-size: 13px;
}

summary {
  cursor: pointer;
}

.chat {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-head {
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.pill {
  border: 1px solid #cbd9e9;
  color: var(--blue);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.messages {
  overflow: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: min(860px, 100%);
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.user .avatar {
  background: var(--blue);
}

.bubble {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.pending {
  color: var(--muted);
}

.bubble.error {
  border-color: #e2a7a7;
  color: #9b1c1c;
  background: #fff5f5;
}

.composer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 18px 28px;
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
}

textarea {
  resize: none;
  min-height: 46px;
  max-height: 140px;
  border: 1px solid var(--line);
  padding: 12px;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }

  .panel.install {
    display: none;
  }

  .chat-head,
  .messages,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

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