:root {
  --orange: #ff7a00;
  --orange-soft: #ffb36b;
  --black: #111111;
  --charcoal: #1f1f1f;
  --white: #fffdf8;
  --cream: #fff4e8;
  --border: rgba(17, 17, 17, 0.12);
  --shadow: 0 24px 80px rgba(17, 17, 17, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 122, 0, 0.22), transparent 28%),
    linear-gradient(135deg, #fffaf4 0%, #fff1de 45%, #111111 150%);
  color: var(--black);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
}

.hero-panel,
.chat-panel {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 32px;
  background: linear-gradient(180deg, #151515 0%, #252525 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-panel h1,
.chat-header h2 {
  margin: 0;
  line-height: 1.05;
}

.hero-panel h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  max-width: 10ch;
}

.hero-copy {
  color: rgba(255, 253, 248, 0.78);
  line-height: 1.6;
}

.hero-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 122, 0, 0.12), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-label,
.eyebrow,
.message-role,
.composer-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.eyebrow {
  color: var(--orange);
  margin: 0 0 10px;
}

.chat-panel {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(100vh - 48px);
  min-height: 0;
}

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

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
}

.status-pill[data-busy="true"] {
  background: var(--orange);
  color: var(--black);
}

.messages {
  padding: 24px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: min(78ch, 100%);
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #ff8e1f 0%, #ff7a00 100%);
  color: var(--black);
}

.message.assistant {
  align-self: flex-start;
  background: var(--white);
}

.message-role {
  margin-bottom: 10px;
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
}

.message-body-rich {
  white-space: normal;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
}

.message-body-rich p,
.message-body-rich ul,
.message-body-rich ol {
  margin: 0;
}

.message-body-rich p + p,
.message-body-rich p + ul,
.message-body-rich p + ol,
.message-body-rich ul + p,
.message-body-rich ol + p,
.message-body-rich ul + ul,
.message-body-rich ol + ol {
  margin-top: 14px;
}

.message-body-rich ul,
.message-body-rich ol {
  padding-left: 22px;
}

.message-body-rich li + li {
  margin-top: 8px;
}

.message-body-rich a {
  color: #d65f00;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-body-rich strong {
  color: var(--black);
}

.composer {
  padding: 20px 28px 28px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 244, 232, 0.9));
}

.composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  padding: 16px 18px;
  background: #ffffff;
  color: var(--black);
}

.composer textarea:focus {
  outline: 2px solid rgba(255, 122, 0, 0.45);
  border-color: rgba(255, 122, 0, 0.5);
}

.composer-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.composer button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.composer button:hover {
  background: var(--orange);
  color: var(--black);
}

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

code {
  display: block;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--orange-soft);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    height: 80vh;
    min-height: 0;
  }
}
