:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #203034;
  background: #f4f5f2;
  font-size: 14px;
  --green: #226354;
  --line: #e1e5df;
  --muted: #718079;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  background: #fff;
  color: inherit;
  transition: 0.15s;
}
button:hover {
  background: #edf1ea;
  border-color: #b9c7bb;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.primary:hover {
  background: #184c3f;
}
.danger {
  color: #a93e34;
}
.ghost {
  background: transparent;
  border-color: transparent;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cdd6ce;
  border-radius: 8px;
  background: white;
  color: inherit;
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #a3c2b1;
  outline-offset: 1px;
}
label {
  display: block;
  font-size: 13px;
  color: #4b5a53;
  margin: 15px 0 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 27px;
  line-height: 1.4;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 15px;
}
.muted,
.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #1c3531;
  color: #d9e4dc;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 19px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 2px;
  color: #fff;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2.4px;
  color: #9fb4a9;
  margin: 8px 0 0;
}
.nav {
  display: grid;
  gap: 5px;
}
.nav button {
  text-align: left;
  background: transparent;
  color: #c5d5cc;
  border: 0;
  padding: 12px;
}
.nav button.active,
.nav button:hover {
  background: #345048;
  color: white;
}
.sidebar .primary {
  background: #d5e4c5;
  color: #213b30;
  border: 0;
  width: 100%;
  font-weight: 600;
}
.chat-list {
  overflow: auto;
  min-height: 50px;
  flex: 1;
}
.chat-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #aebfb5;
  padding: 11px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item.active {
  background: #345048;
  color: white;
}
.sidebar-foot {
  border-top: 1px solid #3c544c;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-foot button {
  color: #bccdc2;
  padding: 5px;
}
.main {
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: #fafbf8;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.topbar .tag {
  margin-left: 12px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  border-radius: 5px;
  padding: 4px 7px;
  background: #e8eee3;
  color: #456044;
}
.tag.amber {
  color: #896223;
  background: #f4ecd8;
}
.content {
  padding: 32px;
  max-width: 1500px;
  margin: auto;
}
.welcome {
  padding: 28px 0 10px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #6b8376;
  margin-bottom: 16px;
}
.lead {
  color: #718079;
  line-height: 1.8;
  max-width: 700px;
}
.card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 23px;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  font-size: 25px;
  font-weight: 600;
  margin: 8px 0;
  color: #244c3b;
}
.notice {
  background: #f5f0e4;
  border: 1px solid #e8ddc2;
  color: #765c2d;
  padding: 13px 17px;
  border-radius: 8px;
  line-height: 1.75;
  font-size: 12px;
  margin-bottom: 18px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
}
.writing-pane {
  min-width: 0;
}
.conversation {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.95;
  font-size: 15px;
}
.message.user {
  padding: 16px 20px;
  border-radius: 10px;
  background: #eaf0e6;
  max-width: 92%;
  align-self: flex-end;
  color: #3a4f3b;
}
.message.assistant {
  padding: 24px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
}
.message-label {
  font-size: 11px;
  color: #788e7e;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.composer {
  padding: 16px;
  background: #fff;
  border: 1px solid #cbd8cc;
  border-radius: 12px;
  margin-top: 22px;
  box-shadow: 0 4px 20px #22332208;
}
.composer textarea {
  border: 0;
  min-height: 100px;
  padding: 4px;
  outline: none;
}
.row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.composer .row {
  margin-top: 10px;
}
.side-card {
  padding: 19px;
  font-size: 12px;
}
.side-card summary {
  font-weight: 600;
  cursor: pointer;
}
.pre {
  white-space: pre-wrap;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.small-scroll {
  max-height: 280px;
  overflow: auto;
}
.source-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.source-item:last-child {
  border-bottom: 0;
}
.source-item .row {
  margin-top: 8px;
}
.job {
  margin-top: 15px;
  padding: 12px 15px;
  border-radius: 8px;
  background: #e8eee5;
  color: #4b6850;
  font-size: 12px;
  line-height: 1.7;
}
.job.failed,
.job.interrupted {
  background: #faeee9;
  color: #955744;
}
.empty {
  padding: 60px 25px;
  text-align: center;
  color: #819082;
}
.empty h2 {
  color: #304d3d;
  margin: 15px;
}
.empty-icon {
  font-size: 35px;
  color: #94ac8b;
}
.list-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.list-row:last-child {
  border: 0;
}
.list-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.btn-small {
  font-size: 12px;
  padding: 6px 9px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.login {
  max-width: 450px;
  margin: 10vh auto;
  padding: 38px;
}
.login-brand {
  margin-bottom: 38px;
  color: #244e3c;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: 3px;
}
.login-brand span {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 10px;
  font-weight: 400;
}
.login .primary {
  width: 100%;
  margin-top: 22px;
}
.loading {
  padding: 100px;
  text-align: center;
  color: #819082;
}
dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: 90vh;
  border: 1px solid #d6dfd3;
  border-radius: 14px;
  padding: 28px;
  color: inherit;
  box-shadow: 0 25px 100px #001a2240;
}
dialog::backdrop {
  background: #16332655;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin-bottom: 22px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.check-row {
  display: flex;
  gap: 9px;
  align-items: center;
}
.check-row input {
  width: 16px;
}
.error {
  color: #a34232;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 12px;
  white-space: pre-wrap;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #233d32;
  color: white;
  padding: 13px 24px;
  border-radius: 10px;
  z-index: 100;
  display: none;
  box-shadow: 0 6px 30px #16332630;
}
.progress-note {
  font-size: 12px;
  color: #739074;
  line-height: 1.8;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.feedback {
  padding: 14px;
  background: #f6f7f3;
  border-radius: 8px;
  margin-top: 10px;
}
.source-select {
  max-height: 160px;
  overflow: auto;
  padding: 7px;
  background: #f6f7f3;
  border-radius: 8px;
}
.view-body {
  max-height: 60vh;
  overflow: auto;
  padding: 10px 0;
}
.meter {
  height: 5px;
  background: #e5ecdf;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0 5px;
}
.meter span {
  height: 100%;
  display: block;
  background: #759767;
}
a {
  color: #226354;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .context-pane {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .context-pane .card {
    margin: 0;
  }
  .content {
    padding: 24px;
  }
  .shell {
    grid-template-columns: 210px 1fr;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px;
    gap: 16px;
  }
  .brand small,
  .sidebar .chat-list,
  .sidebar-foot {
    display: none;
  }
  .brand {
    font-size: 20px;
  }
  .nav {
    display: flex;
    overflow: auto;
  }
  .nav button {
    white-space: nowrap;
    padding: 8px;
  }
  .sidebar > .primary {
    width: auto;
    position: absolute;
    top: 15px;
    right: 18px;
  }
  .topbar {
    padding: 15px 20px;
  }
  .content {
    padding: 20px;
  }
  .grid,
  .two,
  .context-pane {
    grid-template-columns: 1fr;
  }
  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .login {
    margin: 30px 15px;
  }
  .message.assistant {
    padding: 18px;
  }
}
