:root {
  color-scheme: light;
  --ink: #202c31;
  --muted: #52645f;
  --line: #d8e4df;
  --paper: #fffefa;
  --shade: #edf4ef;
  --deep: #164e40;
  --mint: #daf3e7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f0f5f0;
  color: var(--ink);
  font: 14px/1.55 "PingFang SC","Microsoft YaHei",system-ui,sans-serif;
}

h1,h2,p {
  margin: 0;
}

button,input,select,textarea {
  font: inherit;
}

button,select,a {
  cursor: pointer;
}

a {
  color: var(--deep);
}

button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible {
  outline: 2px solid #26775f;
  outline-offset: 2px;
}

[hidden] {
  display: none!important;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 69px;
  padding: 10px clamp(12px,3vw,38px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.wordmark,.account {
  display: flex;
  align-items: center;
  gap: 9px;
}

.wordmark b {
  display: block;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -.04em;
}

.wordmark small,.account label {
  color: var(--muted);
  font-size: 12px;
}

#workbench .wordmark .bot-optic {
  width: 42px;
}

.account {
  flex-wrap: wrap;
}

.account select {
  margin-left: 4px;
}

.mode,.state {
  background: var(--mint);
  color: var(--deep);
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.state[data-state="approval"],.state[data-state="attention"] {
  background: #fff0d5;
  color: #6d4b18;
}

.shell {
  display: grid;
  grid-template-columns: 218px minmax(0,1fr) minmax(270px,32%);
  max-width: 1480px;
  margin: 0 auto;
  min-height: calc(100vh - 69px);
}

.nav,.conversation,.desk {
  min-width: 0;
}

.nav {
  padding: 15px 12px;
  border-right: 1px solid var(--line);
  background: #edf3ed;
}

.nav-title,.conversation-header,.task-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.nav-title h2,.desk h2 {
  font-size: 14px;
}

.nav-title button {
  padding: 2px 8px;
}

.bot-list-title {
  margin-top: 16px;
}

.nav nav {
  display: grid;
  gap: 3px;
  margin-top: 6px;
}

.nav nav button {
  display: flex;
  gap: 7px;
  align-items: center;
  text-align: left;
  min-width: 0;
  width: 100%;
  border-color: transparent;
  background: transparent;
}

.nav nav button[aria-current="page"] {
  background: var(--mint);
  border-color: #b7dfd2;
  color: var(--deep);
  font-weight: 750;
}

#workbench .nav .bot-icon {
  width: 28px;
}

.conversation {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  min-height: 530px;
}

.conversation-header,.desk>header {
  min-height: 65px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.conversation-header h1 {
  font-size: 21px;
  line-height: 1.3;
}

.conversation-header p,.desk p.note {
  color: var(--muted);
  font-size: 12px;
}

.feed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  min-height: 215px;
  height: min(65vh,630px);
  overflow: auto;
  padding: 14px 15px 18px;
  overscroll-behavior: contain;
}

.bubble {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 95%;
}

.bubble.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bubble .bot-icon,.initial {
  width: 28px;
  flex: none;
}

.initial {
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dce7ee;
  color: #314358;
  font-weight: 700;
  font-size: 11px;
}

.bubble-content {
  border: 1px solid var(--line);
  background: #f5f8f3;
  border-radius: 9px;
  padding: 5px 9px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mine .bubble-content {
  background: #e4f5eb;
}

.bubble-content b {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.bubble-content p {
  font-size: 13px;
}

.bubble-content button {
  margin-top: 5px;
  padding: 2px 7px;
  color: var(--deep);
}

.composer {
  padding: 10px 14px 13px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 76px;
  resize: vertical;
  padding: 8px;
  margin: 5px 0;
}

.composer-tools button {
  font-size: 12px;
}

.send {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

button {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
}

button.primary {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
  font-weight: 750;
}

button:disabled {
  opacity: .55;
  cursor: default;
}

select,input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px;
  background: var(--paper);
  color: var(--ink);
}

.desk {
  padding-bottom: 12px;
  background: #f5f8f4;
  border-left: 1px solid var(--line);
}

#desk-content {
  padding: 11px 13px;
  overflow-wrap: anywhere;
}

.task-title {
  align-items: flex-start;
}

.task-title strong {
  min-width: 0;
}

.task-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.task-card p {
  margin-top: 6px;
}

.task-card h3 {
  margin: 11px 0 3px;
  font-size: 14px;
}

.task-card ol {
  padding-left: 20px;
  margin: 4px 0;
}

.task-card li {
  margin: 4px 0;
}

.task-card li small {
  display: block;
  color: var(--muted);
}

.task-card pre {
  margin: 4px 0;
  padding: 7px;
  background: var(--shade);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.task-stages {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.task-stages span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 11px;
  color: var(--muted);
}

.task-stages .current {
  background: var(--mint);
  border-color: #99cbb8;
  color: var(--deep);
  font-weight: 750;
}

.task-stages .finished {
  color: var(--deep);
}

.task-card .result {
  background: var(--mint);
  border-radius: 6px;
  padding: 6px 8px;
}

.desk-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

#workbench .desk-profile .bot-icon {
  width: 65px;
}

.desk-profile h3 {
  margin: 0;
}

.notice {
  position: fixed;
  left: 15px;
  bottom: 15px;
  z-index: 5;
  padding: 8px 11px;
  max-width: min(440px,calc(100vw - 30px));
  background: #263b33;
  color: white;
  border-radius: 7px;
  box-shadow: 0 2px 8px #20383033;
}

dialog {
  width: min(390px,calc(100% - 24px));
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
}

dialog::backdrop {
  background: #243e3780;
}

dialog h2 {
  margin-bottom: 10px;
  font-size: 17px;
}

dialog form {
  display: grid;
  gap: 8px;
}

dialog label {
  display: grid;
  gap: 4px;
}

.room-actions,.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bot-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(120px,1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bot-roster .roster-bot {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  overflow-wrap: anywhere;
}

#workbench .roster-bot .bot-icon {
  width: 32px;
  flex: 0 0 32px;
}

dialog textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.bot-preview {
  display: grid;
  place-items: center;
  min-height: 76px;
  background: var(--shade);
  border-radius: 8px;
}

#workbench .bot-preview .bot-icon {
  width: 58px;
}

.mention {
  display: inline-block;
  margin-right: 7px;
  color: var(--deep);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

@media(max-width:920px) {
  .shell {
    grid-template-columns: 177px minmax(0,1fr) minmax(224px,31%);
  }
  .nav {
    padding-inline: 8px;
  }
}

@media(max-width:730px) {
  .shell {
    grid-template-columns: minmax(0,1fr) minmax(210px,35%);
  }
  .nav {
    grid-column: 1/-1;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav nav {
    grid-template-columns: repeat(auto-fit,minmax(90px,1fr));
  }
  .feed {
    height: 390px;
  }
  .bot-list-title {
    margin-top: 8px;
  }
}

@media(max-width:520px) {
  .shell {
    display: block;
  }
  .conversation {
    min-height: 0;
  }
  .desk {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .feed {
    height: 340px;
  }
  .wordmark b {
    font-size: 17px;
  }
  .nav nav button {
    padding: 3px 4px;
  }
}
