:root {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  color: #203b36;
  background: #f5f7f3;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 960px;
  margin: auto;
  padding: 0 28px;
}
header {
  height: 100px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #dce4db;
}
.brand {
  font-size: 25px;
  font-weight: 750;
  text-decoration: none;
  color: #203b36;
  margin-right: auto;
}
.brand span {
  font-weight: 400;
  color: #7f978c;
}
#account {
  font-size: 12px;
  color: #73867e;
}
#login {
  padding: 100px 0 80px;
  max-width: 620px;
}
.eyebrow {
  letter-spacing: 0.18em;
  color: #678c79;
  font-size: 11px;
  font-weight: 700;
}
h1 {
  font-size: clamp(27px, 4.5vw, 44px);
  line-height: 1.55;
  letter-spacing: -0.04em;
  margin: 20px 0;
}
p {
  line-height: 1.9;
  color: #6b7d73;
}
.line {
  display: inline-block;
  padding: 15px 40px;
  border-radius: 8px;
  background: #06c755;
  color: white;
  text-decoration: none;
  font-weight: 600;
  margin: 24px 0 12px;
}
.note {
  font-size: 11px;
  color: #78867b;
  max-width: 600px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ced9ce;
  border-radius: 8px;
  background: white;
  color: #294638;
  padding: 10px 16px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.intro {
  padding: 45px 0 20px;
}
.intro h1 {
  font-size: 30px;
}
.suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.suggestions button {
  font-size: 12px;
  background: transparent;
}
#messages {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 25px 0;
}
.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
  padding: 18px 22px;
  border-radius: 14px;
  max-width: 90%;
  font-size: 14px;
}
.message.user {
  align-self: flex-end;
  background: #e2ebdf;
}
.message.assistant {
  align-self: flex-start;
  background: white;
  border: 1px solid #e4e9df;
}
.message a {
  color: #327255;
}
form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: white;
  border: 1px solid #cad9ca;
  padding: 12px;
  border-radius: 12px;
  position: sticky;
  bottom: 15px;
}
textarea {
  font: inherit;
  flex: 1;
  min-width: 0;
  border: 0;
  resize: vertical;
  max-height: 220px;
  padding: 10px;
  background: transparent;
  color: inherit;
}
textarea:focus {
  outline: 2px solid #a0b99d;
  border-radius: 6px;
}
#send {
  background: #2d5140;
  color: white;
  border: 0;
}
#status {
  color: #a34528;
  font-size: 13px;
  white-space: pre-wrap;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #7a8b7c;
  border-top: 1px solid #dce4db;
  padding: 25px 0;
  margin-top: 35px;
}
footer a {
  color: inherit;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  main {
    padding: 0 18px;
  }
  header {
    height: 80px;
  }
  #account {
    max-width: 130px;
  }
  #login {
    padding-top: 65px;
  }
  .message {
    max-width: 98%;
  }
  #logout {
    font-size: 11px;
    padding: 8px;
  }
}
.knowledge {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #d3dfd1;
  border-radius: 12px;
  background: #edf2e9;
}
.knowledge summary {
  cursor: pointer;
  font-weight: 600;
}
#document-count {
  font-size: 12px;
  font-weight: 400;
}
#document-upload {
  display: block;
  position: static;
  margin: 16px 0;
  padding: 16px;
}
#document-upload label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}
#document-file {
  max-width: 100%;
  font: inherit;
  font-size: 13px;
}
#document-status {
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.document-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}
.document-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
}
.document-list li button {
  text-align: left;
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: 13px;
}
.document-list li span {
  color: #6b7d73;
  flex-shrink: 0;
}
.preview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.preview-heading h2 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.preview-heading button {
  flex-shrink: 0;
  font-size: 12px;
}
#document-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
  font: inherit;
  font-size: 12px;
  line-height: 1.8;
  padding: 16px;
  background: white;
  border: 1px solid #d3dfd1;
  border-radius: 8px;
}
#document-register {
  background: #2d5140;
  color: white;
}
button:focus-visible,
summary:focus-visible,
input:focus-visible,
pre:focus-visible {
  outline: 3px solid #678c79;
  outline-offset: 3px;
}
.threads {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #d3dfd1;
  border-radius: 12px;
  background: white;
}
.thread-toolbar,
.thread-current {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.thread-toolbar h2 {
  font-size: 15px;
  margin: 0;
}
.thread-toolbar button,
.thread-current button {
  font-size: 12px;
  flex-shrink: 0;
}
#thread-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
}
#thread-list button {
  white-space: nowrap;
  max-width: 260px;
  text-overflow: ellipsis;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 13px;
  border-radius: 20px;
}
#thread-list .thread-active {
  color: white;
  background: #2d5140;
  border-color: #2d5140;
}
#thread-title {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
#thread-name-form {
  position: static;
  flex-wrap: wrap;
  margin-top: 14px;
  align-items: center;
}
#thread-name-form label {
  font-size: 12px;
}
#thread-name {
  min-width: 120px;
  flex: 1;
  border: 1px solid #ced9ce;
  border-radius: 6px;
  padding: 9px;
  font: inherit;
  color: inherit;
}
#message-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  font-size: 11px;
  color: #6b7d73;
}
#message-controls button {
  font-size: 11px;
  padding: 7px 10px;
}
.message > summary {
  cursor: pointer;
  white-space: normal;
}
.answer-toggle {
  font-size: 12px;
  font-weight: 600;
  color: #327255;
}
.answer-preview {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #6b7d73;
  line-height: 1.8;
}
.message[open] .answer-preview {
  display: none;
}
.answer-content {
  margin-top: 12px;
  white-space: pre-wrap;
}
.message {
  scroll-margin-top: 20px;
}
#messages {
  padding-bottom: 40px;
}
#form {
  bottom: 0;
  box-shadow: 0 -10px 20px #f5f7f3;
}

.thread-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.thread-exports button {
  font-size: 11px;
  padding: 7px 10px;
}

#approval-pending { padding: 45px 0; }
#approval-pending h1 { font-size: 28px; }
#approval-pending textarea, #invitation-admin textarea { display: block; width: 100%; margin: 12px 0; border: 1px solid #cad9ca; border-radius: 8px; background: white; font-size: 12px; overflow-wrap: anywhere; }
#invitation-form { display: block; position: static; margin-top: 12px; }
#approval-status, #invitation-status { font-size: 13px; }
