:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde8;
  --accent: #0f8b7e;
  --accent-dark: #0a6159;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.shell {
  min-height: 100vh;
  padding: 32px;
}

.chat {
  width: min(960px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.messages {
  display: flex;
  min-height: 480px;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.message {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.message.user {
  background: #eef8f6;
}

.role {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
}

.content p {
  margin: 0 0 8px;
  line-height: 1.55;
}

.content p:last-child {
  margin-bottom: 0;
}

.governance {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.governance div {
  min-width: 0;
}

.governance dt {
  color: var(--muted);
  font-size: 12px;
}

.governance dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
}

.empty {
  margin: auto;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.error {
  margin: 0 24px 16px;
  color: #b42318;
}

.composer {
  display: flex;
  gap: 12px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
}

.composer input {
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.composer button {
  flex: 0 0 auto;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.composer button:disabled {
  background: #98a2b3;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .shell {
    padding: 12px;
  }

  .header,
  .composer {
    padding-inline: 16px;
  }

  .messages {
    min-height: 420px;
    padding: 16px;
  }

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

  .governance {
    grid-column: 1;
  }
}
