:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #1c2943;
  background: #f1f4f9;
  font-synthesis: none;
  --navy: #202858;
  --amber: #f7a21b;
  --muted: #7e8ba9;
  --border: #dfe5f0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #e9ac42;
  outline-offset: 3px;
}
input:focus,
textarea:focus {
  outline: none;
}
input:focus {
  border-color: #8493b9;
  box-shadow: 0 0 0 3px #e9edf6;
}
button {
  color: inherit;
}
[hidden] {
  display: none !important;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex-shrink: 0;
}
.wordmark {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -1.05px;
  color: var(--navy);
  white-space: nowrap;
}
.wordmark span {
  color: var(--amber);
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 3.1px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 5px;
}
.brand {
  padding: 27px 22px 24px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  display: block;
}
#workspace {
  display: flex;
  height: 100dvh;
}
#sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-content {
  padding: 25px 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.nav-active {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f1f3fa;
  color: var(--navy);
  font-size: 15px;
  font-weight: 650;
  padding: 15px 17px;
  border-radius: 12px;
}
.new-chat {
  margin: 18px 0 26px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.new-chat:hover {
  background: #fafbfe;
}
.history-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 750;
  color: var(--muted);
  padding: 0 12px;
  margin-bottom: 13px;
}
#history {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#history button {
  background: transparent;
  border: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  padding: 11px 12px;
  border-radius: 8px;
  color: #6e7c99;
}
#history button:hover,
#history button.active {
  background: #f1f3fa;
  color: var(--navy);
}
#history .empty-history {
  font-size: 13px;
  color: var(--muted);
  padding: 15px 12px;
}
#more-history {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  margin: 15px 10px;
}
.account {
  border-top: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
}
#avatar {
  height: 36px;
  width: 36px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.account-info {
  flex: 1;
  min-width: 0;
}
.account-info strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-info > span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  color: var(--muted);
  border-radius: 8px;
}
.icon-button:hover {
  background: #f1f3fa;
  color: var(--navy);
}
main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 46px;
  gap: 24px;
}
header h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin: 0;
  font-weight: 700;
  color: var(--navy);
}
.heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
#menu {
  display: none;
}
.model-picker {
  position: relative;
  flex-shrink: 0;
}
#model-toggle {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 11px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
#model-toggle svg {
  width: 15px;
  height: 15px;
}
#model-options {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 245px;
  background: white;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 35px #20285812;
  z-index: 3;
}
#model-options button {
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  padding: 13px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
#model-options button:hover,
#model-options button[aria-selected="true"] {
  background: #f1f3fa;
  color: var(--navy);
}
#scroll-area {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scroll-behavior: smooth;
  padding: 0 46px 20px;
}
#welcome {
  max-width: 760px;
  margin: clamp(45px, 12vh, 155px) auto 40px;
  text-align: center;
}
.welcome-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  background: #fff8eb;
  border: 1px solid #f5ddb0;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #d58d11;
}
.welcome-mark svg {
  width: 25px;
  height: 25px;
}
#welcome h2 {
  font-size: 32px;
  letter-spacing: -1px;
  color: var(--navy);
  margin: 0 0 13px;
  font-weight: 650;
}
#welcome p {
  color: #7885a0;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 40px;
}
.suggestions button {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 20px 18px;
  font-size: 13px;
  color: #66738f;
  line-height: 1.6;
  text-align: left;
  min-height: 99px;
}
.suggestions button:hover {
  border-color: #e6bc69;
  background: #fffcf6;
}
#messages {
  max-width: 860px;
  margin: 18px auto 0;
}
.message {
  margin-bottom: 32px;
}
.user-message {
  display: flex;
  justify-content: flex-end;
}
.user-content {
  background: #e8ecf5;
  border: 1px solid #dce3f0;
  border-radius: 16px 16px 4px 16px;
  padding: 14px 20px;
  max-width: 80%;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.65;
  color: var(--navy);
}
.assistant-message {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px 28px;
  box-shadow: 0 1px 2px #25305204;
}
.answer {
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.answer > :first-child {
  margin-top: 0;
}
.answer > :last-child {
  margin-bottom: 0;
}
.answer p {
  margin: 0 0 16px;
}
.answer h1,
.answer h2,
.answer h3 {
  font-size: 18px;
  line-height: 1.5;
  margin: 23px 0 10px;
}
.answer ul,
.answer ol {
  padding-left: 25px;
}
.answer li {
  padding-left: 3px;
  margin: 5px 0;
}
.answer blockquote {
  margin: 16px 0;
  border-left: 3px solid #e9bc68;
  padding: 4px 18px;
  color: #62708d;
}
.answer a {
  color: var(--navy);
  text-underline-offset: 3px;
}
.answer a.citation {
  display: inline-flex;
  border-radius: 5px;
  background: #fff4df;
  color: #97600a;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.7;
  font-weight: 650;
  text-decoration: none;
  vertical-align: super;
  margin: 0 2px;
}
.answer pre {
  overflow: auto;
  background: #f4f6fa;
  border-radius: 8px;
  padding: 16px;
}
.answer code {
  font-size: 13px;
}
.answer table {
  display: block;
  overflow: auto;
  border-collapse: collapse;
  margin: 20px 0;
  max-width: 100%;
  font-size: 13px;
}
.answer th,
.answer td {
  border: 1px solid var(--border);
  padding: 9px 13px;
  text-align: left;
}
.answer th {
  background: #f4f6fa;
}
.answer hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
.answer-footer {
  border-top: 1px solid #edf0f6;
  margin-top: 20px;
  padding-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
}
.sources {
  font-size: 12px;
  color: #73809b;
  flex: 1;
}
.sources summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  padding: 7px 0;
}
.sources summary::before {
  content: "▸";
  margin-right: 7px;
}
.sources[open] summary::before {
  content: "▾";
}
.sources button {
  background: #f6f8fc;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  text-align: left;
  margin: 6px 5px 0 0;
  padding: 8px 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #586789;
}
.copy-button {
  border: 0;
  background: none;
  color: #8a96af;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 6px;
  border-radius: 5px;
}
.copy-button:hover {
  background: #f4f6fa;
}
.copy-button svg {
  width: 15px;
  height: 15px;
}
#pending {
  max-width: 860px;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7c88a2;
  font-size: 13px;
  padding: 12px 2px;
}
.thinking-dots {
  display: flex;
  gap: 4px;
}
.thinking-dots i {
  width: 5px;
  height: 5px;
  background: #daa246;
  border-radius: 50%;
  animation: pulse 1.3s infinite;
}
.thinking-dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking-dots i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
  }
  40% {
    opacity: 1;
  }
}
.composer-area {
  padding: 8px 46px 30px;
}
#chat-form {
  max-width: 860px;
  margin: auto;
  background: #fff;
  border: 1px solid #d8e0ee;
  border-radius: 16px;
  box-shadow: 0 3px 14px #20285805;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 15px 16px 15px 21px;
}
#chat-form:focus-within {
  border-color: #a6b2ca;
}
#question {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  background: transparent;
  max-height: 180px;
  min-height: 28px;
  padding: 7px 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--navy);
}
#question::placeholder {
  color: #94a0b6;
}
.primary {
  background: var(--amber);
  border: 1px solid #ee9912;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}
#send {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
}
.primary:hover:not(:disabled) {
  background: #ed9610;
}
#chat-error {
  max-width: 860px;
  margin: 0 auto 12px;
  font-size: 13px;
  padding: 12px 16px;
  background: #fff2ec;
  color: #964729;
  border: 1px solid #f1d2c1;
  border-radius: 10px;
}
#login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 25px;
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: min(430px, 100%);
  box-shadow: 0 8px 40px #20285805;
}
.login-card h1 {
  font-size: 26px;
  letter-spacing: -0.7px;
  color: var(--navy);
  margin: 40px 0 10px;
}
.login-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 24px 0 9px;
  color: #64718c;
}
.login-card input {
  width: 100%;
  border: 1px solid var(--border);
  background: #fafbfe;
  padding: 13px 14px;
  border-radius: 9px;
  color: var(--navy);
}
.login-card .primary {
  width: 100%;
  padding: 13px;
  justify-content: space-between;
  margin-top: 22px;
}
.login-card #login-error {
  color: #a34429;
  margin: 12px 0 0;
  font-size: 12px;
}
dialog {
  width: min(680px, calc(100% - 32px));
  max-height: 85dvh;
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 26px 30px;
  color: #1c2943;
  box-shadow: 0 20px 80px #20285830;
}
dialog::backdrop {
  background: #1c29434d;
}
.source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eyebrow {
  color: #bd7c0d;
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
}
dialog h2 {
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  margin: 12px 0 20px;
}
#source-content {
  background: #f5f7fb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#source-link {
  display: inline-block;
  color: var(--navy);
  margin-top: 22px;
  font-size: 13px;
  text-underline-offset: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
@media (min-width: 1600px) {
  #sidebar {
    width: 300px;
  }
  header {
    padding: 38px 60px;
  }
  #scroll-area {
    padding: 0 60px 20px;
  }
  .composer-area {
    padding: 8px 60px 36px;
  }
}
@media (max-width: 1000px) {
  #sidebar {
    width: 248px;
  }
  .wordmark {
    font-size: 22px;
  }
  header {
    padding: 25px 28px;
  }
  header h1 {
    font-size: 23px;
  }
  #scroll-area {
    padding: 0 28px 20px;
  }
  .composer-area {
    padding: 8px 28px 24px;
  }
  .suggestions {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin: 28px auto 0;
  }
  .suggestions button {
    min-height: 0;
    padding: 16px 18px;
  }
}
@media (max-width: 760px) {
  #sidebar {
    position: fixed;
    z-index: 6;
    height: 100dvh;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  body.sidebar-open #sidebar {
    transform: translateX(0);
  }
  #scrim {
    position: fixed;
    inset: 0;
    background: #20285845;
    z-index: 5;
  }
  #menu {
    display: grid;
  }
  header {
    padding: 20px 16px;
    gap: 8px;
  }
  header h1 {
    font-size: 19px;
    letter-spacing: -0.5px;
  }
  #model-toggle {
    font-size: 11px;
    padding: 10px;
    gap: 8px;
    border-radius: 9px;
  }
  #model-label {
    max-width: 122px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #scroll-area {
    padding: 0 16px 20px;
  }
  .composer-area {
    padding: 8px 16px 18px;
  }
  #welcome {
    margin: 45px auto 30px;
  }
  #welcome h2 {
    font-size: 27px;
  }
  #welcome p {
    font-size: 14px;
  }
  .welcome-mark {
    margin-bottom: 20px;
  }
  .suggestions {
    gap: 10px;
  }
  .suggestions button {
    font-size: 12px;
  }
  .assistant-message {
    padding: 20px;
  }
  .answer {
    font-size: 14px;
  }
  .user-content {
    max-width: 90%;
    font-size: 14px;
    padding: 12px 16px;
  }
  .message {
    margin-bottom: 23px;
  }
  #chat-form {
    padding: 12px 12px 12px 16px;
    gap: 8px;
  }
  #question {
    font-size: 14px;
  }
  .login-card {
    padding: 30px;
  }
  dialog {
    padding: 20px;
  }
}

#older-messages {
  display: block;
  margin: 0 auto 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}
