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

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: #ffffff;
  border-bottom: 1px solid #d7dde3;
}

.topActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.signedInUser {
  max-width: 260px;
  color: #52606d;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 2px;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

.status {
  min-width: 112px;
  padding: 8px 10px;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  background: #f8fafc;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.status[data-mode="ok"] {
  border-color: #27845f;
  color: #146044;
}

.status[data-mode="error"] {
  border-color: #c43d32;
  color: #9f1d15;
}

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

.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-right: 1px solid #d7dde3;
  background: #eef2f5;
}

label,
dt {
  color: #52606d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
}

input {
  min-height: 40px;
  padding: 8px 10px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 8px 0;
}

dd {
  margin: 4px 0 0;
  color: #17202a;
  font-weight: 700;
  overflow-wrap: anywhere;
}

button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #17202a;
  border-radius: 6px;
  background: #17202a;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chat {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  background: #ffffff;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 24px clamp(18px, 4vw, 44px);
  overflow: auto;
}

.message {
  max-width: 820px;
  padding: 14px 16px;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #f8fafc;
}

.message[data-role="user"] {
  align-self: flex-end;
  background: #fff7ed;
  border-color: #fed7aa;
}

.messageRole {
  margin-bottom: 6px;
  color: #52606d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.messageText {
  white-space: pre-wrap;
  line-height: 1.5;
}

.messageMeta {
  min-height: 16px;
  margin-top: 8px;
  color: #697783;
  font-size: 12px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 12px;
  padding: 18px clamp(18px, 4vw, 44px);
  border-top: 1px solid #d7dde3;
  background: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 180px;
  padding: 10px 12px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topActions {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .side {
    border-right: 0;
    border-bottom: 1px solid #d7dde3;
  }

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