:root {
  color-scheme: light;
  --ei-purple: #291a77;
  --ei-purple-2: #5f2ee5;
  --ei-gold: #f2ae22;
  --ink: #221b3f;
  --muted: #736b8b;
  --line: #e5defb;
  --surface: #ffffff;
  --soft: #f7f4ff;
  font-family: Parkinsans, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  font-family: Parkinsans, Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
textarea {
  font: inherit;
}

.shell,
.chat-panel {
  height: 100dvh;
  min-height: 0;
}

.shell {
  display: grid;
  background: var(--surface);
}

.chat-panel {
  width: 100%;
  margin: 0;
  background: var(--surface);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  color: #fff;
  background: linear-gradient(90deg, var(--ei-purple), var(--ei-purple-2));
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  width: 136px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.eyebrow {
  display: none;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
}

h1 {
  color: #fff;
  font-size: 1rem;
}

.status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ei-gold);
}

.status.error .status-dot {
  background: #ea4335;
}

.intro {
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.starters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.starters::-webkit-scrollbar {
  display: none;
}

.starters button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ei-purple);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
}

.starters button:last-child {
  grid-column: 1 / -1;
}

.starters button:hover {
  border-color: #b797ff;
  background: var(--soft);
}

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

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.bubble,
.answer-summary,
.answer-details,
.sources {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(41, 26, 119, 0.06);
}

.bubble {
  max-width: min(620px, 92%);
  padding: 12px 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.assistant .bubble {
  background: var(--soft);
}

.user .bubble {
  color: #fff;
  background: linear-gradient(90deg, var(--ei-purple), var(--ei-purple-2));
  border: 0;
}

.answer-card {
  width: min(680px, 100%);
  display: grid;
  gap: 10px;
}

.answer-summary {
  padding: 14px;
  background: var(--soft);
}

.answer-label {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--ei-gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.answer-summary p,
.notes p {
  margin: 0;
  color: var(--ink);
  line-height: 1.52;
}

.answer-steps {
  display: none;
}

.text-action {
  display: none;
}

.answer-details {
  overflow: hidden;
}

.answer-details summary,
.sources summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--ei-purple);
  font-size: 0.9rem;
  font-weight: 700;
}

.notes {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.sources {
  background: #fff;
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 10px 10px;
}

.source-card {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.source-card::after {
  content: "Open";
  flex: 0 0 auto;
  color: var(--ei-purple-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.source-card:hover {
  border-color: #b797ff;
  background: #fbfaff;
}

.source-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ei-purple);
  font-size: 0.88rem;
  line-height: 1.25;
}

.source-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 9px;
  align-items: end;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  color: var(--ink);
  outline: none;
  line-height: 1.35;
}

textarea:focus {
  border-color: var(--ei-purple);
  box-shadow: none;
}

.composer button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--ei-purple-2);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.composer button:disabled {
  opacity: 0.62;
  cursor: progress;
}

.composer svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.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: 540px) {
  .topbar {
    padding: 9px 12px;
  }

  .brand-lockup img {
    width: 126px;
  }

  h1 {
    font-size: 0.95rem;
  }

  .status span:last-child {
    display: none;
  }

  .messages {
    padding: 12px;
  }

  .bubble {
    max-width: 100%;
  }
}

@media (max-height: 600px) {
  .topbar {
    min-height: 48px;
  }

  .brand-lockup img {
    width: 118px;
  }

  .intro {
    padding: 8px 10px;
  }

  .starters button {
    padding: 7px 9px;
    font-size: 0.74rem;
  }
}
