:root {
  color-scheme: light;
  --bg: #f4efe6;
  --bg-accent: #ead9b7;
  --surface: rgba(255, 252, 247, 0.9);
  --surface-strong: #fffdf8;
  --text: #1a1714;
  --muted: #62584d;
  --line: rgba(26, 23, 20, 0.12);
  --brand: #0f766e;
  --brand-strong: #0b5d57;
  --agent: #1434a4;
  --user: #7c2d12;
  --error: #b42318;
  --shadow: 0 24px 70px rgba(67, 42, 12, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(234, 217, 183, 0.95), transparent 22%),
    linear-gradient(180deg, #f9f4eb 0%, var(--bg) 48%, #efe6d5 100%);
:root {
  color-scheme: light;
  --bg: #faf6ee;
  --surface: #fffdf9;
  --surface-soft: #f5efe2;
  --line: #ddd2bd;
  --text: #1f1b16;
  --muted: #6d6254;
  --brand: #0a7f78;
  --brand-strong: #08635e;
  --agent: #2142ad;
  --user: #8a3d11;
  --system: #b31f24;
  --shadow: 0 12px 40px rgba(52, 37, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

.app-body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fcf8ef 0%, var(--bg) 100%);
  position: relative;
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.bg-orb-left {
  top: -120px;
  left: -120px;
  background: #bde7df;
}

.bg-orb-right {
  right: -120px;
  bottom: -140px;
  background: #eadfbe;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.brand-wrap h1 {
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  letter-spacing: -0.03em;
}

.eyebrow,
.status-pill,
.message-role,
.hint {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  margin: 0;
  font-size: 0.74rem;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.status-pill {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--brand-strong);
  background: #ddf3ef;
  border: 1px solid #bde5dd;
}

.chat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(380px, 1fr) auto;
  min-height: calc(100vh - 110px);
}

.message-list {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: min(86%, 760px);
}

.message.user {
  align-self: flex-end;
}

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

.message-role {
  margin: 0 0 5px;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.message.user .message-role {
  color: var(--user);
}

.message.assistant .message-role {
  color: var(--agent);
}

.message.system .message-role {
  color: var(--system);
}

.message-body {
  white-space: pre-wrap;
  line-height: 1.55;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e5ddcf;
  background: #fffefb;
}

.message.user .message-body {
  background: #f6e1d0;
  border-color: #e3c8b0;
}

.message.assistant .message-body {
  background: #edf3ff;
  border-color: #d7e3ff;
}

.message.system .message-body {
  background: #feeceb;
  border-color: #f8c8c5;
}

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

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 700;
}

select,
textarea,
button {
  font: inherit;
}

select {
  min-width: 220px;
  max-width: 100%;
  border: 1px solid #d3c7b1;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 88px;
  max-height: 260px;
  resize: vertical;
  border: 1px solid #d3c7b1;
  border-radius: 12px;
  padding: 12px;
  line-height: 1.45;
  background: #fff;
  color: var(--text);
}

select:focus,
textarea:focus {
  outline: 2px solid #c3ebe5;
  border-color: #89d6cb;
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hint {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

button {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
}

#send-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  min-width: 112px;
}

#send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-button {
  background: #fff;
  color: var(--text);
  border: 1px solid #d7ccb8;
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100% - 12px);
    padding: 10px 0 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }

  .chat-card {
    border-radius: 14px;
    min-height: calc(100vh - 86px);
  }

  .message {
    max-width: 94%;
  }

  .control-row {
    align-items: stretch;
  }

  select,
  .secondary-button {
    width: 100%;
  }

  .composer-footer {
    flex-direction: column;
    align-items: stretch;
  }

  #send-button {
    width: 100%;
  .info-panel {
    grid-template-columns: 1fr;
