:root {
  color-scheme: light;
  --ink: #16211d;
  --muted: #5d6863;
  --line: #d9e1dc;
  --paper: #fbfcf9;
  --panel: #ffffff;
  --green: #167449;
  --gold: #d3a12c;
  --red: #b13f32;
  --focus: #0f6b99;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(22, 116, 73, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(211, 161, 44, 0.14), transparent 32%),
    var(--paper);
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 28px;
  align-items: stretch;
  padding: 28px 0;
}

.intro,
.workspace {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.intro {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

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

.mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.72) 45%, rgba(255, 255, 255, 0.72) 55%, transparent 56%),
    linear-gradient(0deg, var(--red) 0 33%, var(--gold) 33% 66%, var(--green) 66%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.84), 0 10px 20px rgba(22, 33, 29, 0.12);
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  line-height: 0.94;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.quick-grid button,
.composer button {
  border: 0;
  background: var(--green);
  color: white;
  min-height: 46px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.quick-grid button {
  text-align: left;
  background: #edf6f1;
  color: var(--ink);
  border-left: 4px solid var(--gold);
}

.quick-grid button:hover,
.quick-grid button:focus-visible {
  background: #e2f0e9;
}

.workspace {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: 1fr auto;
}

.messages {
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  width: min(760px, 100%);
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.message.user {
  margin-left: auto;
  background: #f3f7f5;
  border-color: #cbd9d2;
}

.message.assistant {
  border-top: 4px solid var(--green);
}

.message p {
  margin: 0;
  line-height: 1.55;
}

.sources {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.sources a {
  color: var(--focus);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: rgba(255, 255, 255, 0.86);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  max-height: 180px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--ink);
}

textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 107, 153, 0.22);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .shell {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .intro,
  .workspace {
    border-left: 0;
    border-right: 0;
  }

  .intro {
    min-height: 42vh;
  }

  .workspace {
    min-height: 58vh;
  }

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