:root {
  --bg: #f8f9f5;
  --ink: #243c32;
  --green: #28553f;
  --muted: #748078;
  --line: #e1e7de;
  --white: #fff;
  --lime: #e4edc6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  outline-offset: 5px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  padding: 11px 17px;
  border-radius: 9px;
  color: var(--ink);
}
button:hover {
  filter: brightness(0.97);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -3px;
}
.leo-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  padding: 4px;
  margin-right: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.dot {
  color: #7f9960;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.2px;
  font-weight: 700;
  color: #788b77;
}
.primary {
  background: var(--green);
  color: white;
  border: 0;
  font-weight: 600;
  padding: 13px 20px;
}
.primary span {
  float: right;
}
.text-button {
  border: 0;
  background: none;
  padding: 8px 0;
  color: #607451;
  font-size: 13px;
}
.small {
  font-size: 12px;
  line-height: 1.7;
}
.muted {
  color: var(--muted);
}
h1 {
  font-size: 38px;
  letter-spacing: -1.5px;
  font-weight: 500;
  margin: 16px 0;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  font-weight: 550;
}
p {
  line-height: 1.65;
}
.welcome {
  min-height: 100vh;
  padding: 48px 7%;
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  background: radial-gradient(ellipse at 0 80%, #e7edda, transparent 65%);
}
.welcome > .brand {
  position: absolute;
  top: 40px;
  left: 7%;
}
.welcome-copy h1 {
  font-family: Georgia, serif;
  font-size: 66px;
  line-height: 1.09;
  letter-spacing: -2px;
}
.welcome-copy p {
  color: #6a7b6b;
}
.promise {
  margin-top: 40px;
  font-size: 13px;
}
.login-card {
  max-width: 410px;
  background: #fff;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 60px 0;
  box-shadow: 0 16px 60px #253c3207;
}
.login-card h2 {
  font-size: 28px;
}
.login-card > p {
  color: var(--muted);
}
.login-card button {
  width: 100%;
}
label {
  display: block;
  font-size: 12px;
}
input {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 17px;
  background: #fcfdfb;
}
input[type="checkbox"] {
  display: inline;
  width: auto;
  margin: 0 8px 0 0;
  accent-color: var(--green);
}
.divider {
  font-size: 11px;
  color: #8b948e;
  text-align: center;
  margin: 24px 0;
}
.welcome-footer {
  position: absolute;
  bottom: 25px;
  font-size: 10px;
  letter-spacing: 2px;
}
.mode {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 11px;
  font-size: 10px;
  color: #758361;
}
textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 105px;
  line-height: 1.7;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
}
textarea::placeholder {
  color: #9aab98;
}
.switch {
  font-size: 11px;
  color: #7d8875;
  white-space: nowrap;
}
.dismiss {
  font-size: 10px;
  color: #919a8b;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
#toast {
  position: fixed;
  right: 25px;
  top: 22px;
  max-width: 400px;
  background: #244b3d;
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  z-index: 5;
  box-shadow: 0 4px 25px #0002;
  display: none;
}
#toast.show {
  display: block;
}
@media (max-width: 1000px) {
  .welcome-copy h1 {
    font-size: 49px;
  }

}
@media (max-width: 700px) {
  .welcome {
    display: block;
    padding: 130px 24px 50px;
  }
  .welcome-copy h1 {
    font-size: 44px;
  }
  .welcome-copy p br {
    display: none;
  }
  .login-card {
    margin: 35px auto;
  }
  .side-caption,
  .side-note,
  .account {
    display: none;
  }
  .switch {
    white-space: normal;
  }

}
@media (max-width: 700px) {
  .welcome-footer {
    max-width: calc(100% - 48px);
    line-height: 1.7;
  }

}
#source-fields {
  padding: 1rem;
  background: #f4f5ef;
  border-radius: 12px;
  margin-bottom: 1rem;
}
#source-fields label {
  display: block;
  margin: 1rem 0 0.4rem;
}
#source-fields input,
#source-fields textarea {
  width: 100%;
  box-sizing: border-box;
}
.evidence-point {
  border-top: 1px solid #ddd;
  padding: 0.75rem 0;
}
.evidence-point summary {
  cursor: pointer;
  color: #315941;
}
blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid #a6ba8d;
  white-space: pre-wrap;
}
.source-limits {
  font-size: 0.9rem;
  line-height: 1.6;
}
.original-source {
  padding: 1rem;
  background: #f4f5ef;
}
.pilot-notice {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 16px 64px;
  line-height: 1.6;
}
.pilot-notice h2 {
  margin-top: 32px;
  color: var(--green);
}
.pilot-notice a {
  color: var(--green);
}
.feedback {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-options .text-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  min-height: 36px;
}
.feedback summary {
  margin-top: 12px;
  cursor: pointer;
  color: var(--green);
}
.feedback-options .chosen {
  background: var(--lime);
  color: var(--green);
  font-weight: 600;
}
.feedback details textarea {
  width: 100%;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}


/* Chat: conversations | chat | suggestions */
.chat-app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  height: 100dvh;
}
.chat-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 16px;
  background: #f1f4ec;
  overflow-y: auto;
}
.conversations {
  border-right: 1px solid var(--line);
}
.suggestions {
  border-left: 1px solid var(--line);
}
.chat-side .brand {
  font-size: 22px;
}
.chat-side .leo-logo {
  width: 40px;
  height: 40px;
}
.new-chat {
  width: 100%;
}
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.conversation {
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversation.active,
.conversation:hover {
  background: var(--lime);
}
.account {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.account a {
  color: var(--green);
  text-decoration: underline;
}
.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.chat-header h1 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-button {
  border: 0;
  background: none;
  padding: 8px 10px;
  min-width: 40px;
  min-height: 40px;
}
#open-conversations,
#open-suggestions {
  display: none;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px max(20px, calc((100% - 760px) / 2));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-empty {
  margin: auto;
  text-align: center;
  max-width: 420px;
}
.chat-empty img {
  border-radius: 50%;
}
.msg {
  max-width: 100%;
  line-height: 1.6;
}
.msg p {
  margin: 0;
}
.msg-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.mine {
  align-self: flex-end;
  max-width: 80%;
  background: var(--lime);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
}
.msg-source {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.msg.gato {
  align-self: flex-start;
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 16px 16px 16px 4px;
}
.msg.failed {
  border-color: #d9b8a0;
  background: #fbf5f0;
}
.typing {
  color: var(--muted);
  font-style: italic;
}
.chat-composer {
  padding: 10px max(20px, calc((100% - 760px) / 2)) 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 6px 6px 12px;
}
.composer-row:focus-within {
  border-color: var(--green);
}
.chat-composer #prompt {
  flex: 1;
  min-height: 0;
  max-height: 200px;
  resize: none;
  font-size: 16px;
  padding: 8px 0;
  line-height: 1.5;
}
.paste-toggle {
  white-space: nowrap;
  padding: 8px 4px;
}
.send {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}
.composer-hint {
  text-align: center;
  margin: 6px 0 0;
}
.source-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 12px;
  background: #f1f4ec;
  border-radius: 999px;
  font-size: 13px;
}
.source-chip .text-button {
  padding: 4px 8px;
}
.suggestions h2 {
  margin: 0;
  font-size: 18px;
}
.suggestions section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.suggestions h3 {
  margin: 8px 0 0;
}
.suggestions .switch {
  white-space: normal;
  font-size: 13px;
  color: var(--ink);
}
.suggestions a {
  color: var(--green);
  text-decoration: underline;
}
.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.suggestion {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.suggestion p {
  margin: 4px 0 0;
}
.suggestion-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.suggestion-chip {
  text-align: left;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}
.scrim {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.3);
  z-index: 9;
}
@media (max-width: 1100px) {
  .chat-app {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  #open-suggestions {
    display: inline-block;
  }
  .suggestions {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 90vw);
    z-index: 10;
    transform: translateX(100%);
    transition: transform 0.2s;
  }
  .show-suggestions .suggestions {
    transform: none;
  }
}
@media (max-width: 760px) {
  .chat-app {
    grid-template-columns: minmax(0, 1fr);
  }
  #open-conversations {
    display: inline-block;
  }
  .conversations {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 85vw);
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .show-conversations .conversations {
    transform: none;
  }
  .chat-header .mode {
    display: none;
  }
  .messages,
  .chat-composer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .msg.mine {
    max-width: 90%;
  }
  .paste-toggle {
    font-size: 0;
  }
  .paste-toggle::before {
    content: "📄";
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .suggestions,
  .conversations {
    transition: none;
  }
}
.account .text-button {
  align-self: flex-start;
}
