:root {
  --sidebar: 218px;
}
.office-switch {
  margin: 0 14px 16px;
  background: #eaeaea;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.office-switch span {
  color: #858585;
  font-size: 11px;
  font-weight: 400;
}
.sidebar-history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}
.sidebar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 6px;
}
.sidebar-section strong {
  font-size: 12px;
}
.history-item {
  display: flex;
  width: 100%;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  text-align: left;
  align-items: center;
  font-size: 12px;
}
.history-item span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.history-item:hover,
.history-item.active {
  background: #eaeaea;
}
.history-empty {
  padding: 10px;
}
.task-dot {
  background: #379576;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.scope-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.agent-main {
  background: #fff;
}
.agent-workspace {
  width: min(920px, calc(100% - 70px));
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 35px 0;
}
.agent-welcome {
  margin: 0 0 32px;
  text-align: center;
}
.agent-welcome h1 {
  font-size: 38px;
  letter-spacing: -1px;
}
.agent-welcome p {
  margin: 16px 0 34px;
  color: #8c8c8c;
  font-size: 14px;
}
.task-suggestions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.task-suggestions .btn {
  border: 1px solid #e8e8e8;
  background: white;
  border-radius: 12px;
  font-size: 12px;
}
.agent-composer {
  border: 1px solid #333;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 12px 35px #00000005;
  flex: none;
}
.agent-composer textarea {
  width: 100%;
  height: 132px;
  padding: 22px;
  border: 0;
  border-radius: 19px;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.7;
  outline: none;
}
.agent-composer textarea:focus {
  box-shadow: none;
}
.agent-composer footer {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  gap: 10px;
}
.agent-composer label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.agent-composer select {
  border: 0;
  background: #f8f8f8;
  border-radius: 6px;
  padding: 7px;
  max-width: 300px;
  font-size: 12px;
}
.agent-footnote {
  text-align: center;
  color: #999;
  font-size: 11px;
  margin: 12px 0 0;
}
.has-session {
  padding: 12px 0 20px;
  justify-content: flex-start;
}
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 20px;
}
.session-header h2 {
  font-size: 18px;
}
.session-header p {
  color: #929292;
  font-size: 11px;
  margin-top: 5px;
}
.task-timeline {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 8px 30px;
  scroll-behavior: smooth;
}
.task-user {
  margin: 8px 0 25px auto;
  max-width: 85%;
  width: fit-content;
  background: #f2f2f2;
  border-radius: 14px;
  padding: 13px 18px;
  white-space: pre-wrap;
  line-height: 1.8;
}
.task-assistant {
  margin: 16px 0 30px;
}
.task-assistant > strong {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
}
.answer-text {
  white-space: pre-wrap;
  line-height: 1.9;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.task-knowledge {
  margin: 18px 0;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 14px;
}
.task-knowledge summary {
  color: #68766c;
  cursor: pointer;
}
.task-knowledge .chat-answer {
  padding: 15px 0 0;
}
.has-session .agent-composer textarea {
  height: 84px;
}
.task-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #f7f8f7;
  padding: 14px;
  border-radius: 10px;
  margin: 15px 0;
  color: #6b786f;
  font-size: 12px;
}
.task-progress.failed {
  color: #9b5949;
  background: #fcf7f5;
}
.task-audit {
  margin-top: 20px;
  font-size: 11px;
  color: #888;
}
.task-audit > div {
  border-bottom: 1px solid #eee;
  padding: 8px 0;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 13px;
}
.form-field input,
.form-field select {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}
.form-field[hidden] {
  display: none;
}
.eke-drawer.wide:has(.template-layout) {
  width: min(1120px, 95vw);
}
.template-tabs {
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
  margin-bottom: 20px;
  font-weight: 600;
}
.template-tabs span {
  float: right;
  font-size: 12px;
  color: #999;
  font-weight: 400;
}
.template-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr);
  gap: 22px;
  margin: 20px 0;
  align-items: start;
}
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.template-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 20px 18px;
  min-height: 165px;
}
.template-card:hover {
  border-color: #aaa;
}
.template-card.selected {
  border-color: #757575;
  background: #f5f5f5;
}
.template-card strong {
  font-size: 15px;
}
.template-card strong span {
  float: right;
}
.template-card p {
  color: #888;
  font-size: 12px;
  line-height: 1.8;
}
.template-card small {
  color: #999;
  font-size: 10px;
}
.template-card em {
  font-style: normal;
  color: #698071;
  font-size: 11px;
}
.template-preview {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 22px;
  max-height: 570px;
  overflow: auto;
  font-size: 12px;
}
.template-preview h3 {
  margin: 0 0 14px;
}
.template-preview h4 {
  margin: 22px 0 12px;
  color: #777;
}
.template-preview details {
  margin: 8px 0;
}
.template-preview summary {
  cursor: pointer;
  line-height: 1.8;
}
.template-preview summary span {
  color: #999;
  font-size: 10px;
}
.template-preview p {
  color: #777;
  line-height: 1.8;
}
.template-field {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.template-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 25px;
  border-top: 1px solid #eee;
}
.shell-collapsed .sidebar-history,
.shell-collapsed .office-switch {
  display: none;
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 190px;
  }
  .agent-workspace {
    width: calc(100% - 45px);
  }
  .template-card {
    padding: 16px 12px;
  }
}
@media (max-width: 760px) {
  .template-layout {
    grid-template-columns: 1fr;
  }
  .template-preview {
    max-height: 320px;
  }
  .agent-welcome h1 {
    font-size: 28px;
  }
  .agent-workspace {
    width: calc(100% - 24px);
  }
  .agent-composer select {
    max-width: 170px;
  }
}
.nav > .btn.navbtn {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 11px 14px;
}
.nav > .btn.navbtn.active,
.nav > .btn.navbtn:hover {
  background: #eaeaea;
}
.answer-text {
  white-space: normal;
}
.answer-text h3 {
  margin: 16px 0 8px;
}
.answer-text pre {
  white-space: pre-wrap;
  background: #f6f6f6;
  padding: 14px;
  border-radius: 8px;
}
.answer-text code {
  background: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
}
.answer-table {
  overflow: auto;
  margin: 10px 0;
}
.answer-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.answer-table td,
.answer-table th {
  border: 1px solid #e6e6e6;
  padding: 9px;
  text-align: left;
  min-width: 100px;
}
.agent-workspace.project-chat {
  justify-content: flex-start;
  overflow: auto;
  padding-top: 34px;
}
.project-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.project-chat-header p {
  color: #909090;
  font-size: 12px;
  margin-bottom: 8px;
}
.project-chat-header h1 {
  font-size: 28px;
  margin: 0 0 12px;
}
.project-chat-header span {
  font-size: 13px;
  color: #888;
}
.project-conversations {
  margin-top: 36px;
}
.project-conversations > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.project-conversations h2 {
  font-size: 15px;
}
.project-conversation {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 10px;
  border-bottom: 1px solid #efefef;
  text-align: left;
  border-radius: 8px;
}
.project-conversation:hover {
  background: #fafafa;
}
.project-conversation > span:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.project-conversation strong {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-chat-empty {
  color: #999;
  font-size: 13px;
  padding: 28px 0;
}
.knowledge-group {
  margin: 4px 0 16px;
}
.knowledge-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 4px;
  text-align: left;
  color: #777;
}
.knowledge-group-heading strong {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
}
.knowledge-group-heading > span:last-child {
  font-size: 10px;
  color: #aaa;
}
.group-chevron {
  width: 13px;
  text-align: center;
  color: #999;
}
.knowledge-instances {
  padding-left: 10px;
}
.knowledge-instances .knowledge-entry {
  color: #777;
  padding: 12px 8px;
  border-radius: 8px;
}
.knowledge-instances .knowledge-entry.active {
  color: #222;
  font-weight: 500;
}
.branch-more {
  margin: 6px 0 4px 8px;
}
.graph-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
}
.graph-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  background: white;
  position: relative;
  z-index: 3;
}
.graph-search {
  width: min(300px, 55%);
  position: relative;
}
.graph-search > label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 8px 10px;
  color: #999;
}
.graph-search input {
  border: 0;
  width: 100%;
  min-width: 0;
  outline: none;
  font-size: 12px;
  background: transparent;
}
.graph-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  padding: 8px;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  box-shadow: 0 12px 30px #00000010;
  max-height: 280px;
  overflow: auto;
}
.graph-search-results button {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
}
.graph-search-results button:hover {
  background: #f5f5f5;
}
.graph-search-results small {
  color: #999;
}
.graph-type-filter {
  position: relative;
}
.graph-type-filter summary {
  cursor: pointer;
  list-style: none;
}
.graph-type-filter summary::-webkit-details-marker {
  display: none;
}
.graph-type-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 230px;
  max-height: 350px;
  overflow: auto;
  padding: 18px;
  border: 1px solid #e7e7e7;
  background: white;
  box-shadow: 0 14px 35px #00000010;
  border-radius: 12px;
}
.graph-type-menu > strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #8e998e;
  margin-bottom: 14px;
}
.graph-type-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  font-size: 12px;
  cursor: pointer;
}
.graph-type-menu input {
  width: 15px;
  height: 15px;
  accent-color: #202625;
}
.graph-type-menu small {
  margin-left: auto;
  color: #aaa;
}
.graph-type-menu .btn {
  margin-top: 10px;
}
.graph-type-dot {
  height: 6px;
  width: 6px;
  background: #77988c;
  border-radius: 50%;
}
.graph-filter-empty {
  position: absolute;
  top: 45%;
  width: 100%;
  text-align: center;
  color: #8d968f;
  font-size: 13px;
}
.graph-shell .graph-stage svg {
  min-height: 280px;
}
@media (max-width: 760px) {
  .project-chat-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .project-conversation {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .graph-toolbar {
    padding: 10px;
    gap: 8px;
  }
  .graph-toolbar > .small-note {
    display: none;
  }
  .graph-type-menu {
    left: auto;
    right: 0;
  }
}
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}
.member-row > div:first-child {
  flex: 1;
}
.member-row select {
  max-width: 140px;
}
.member-add {
  display: grid;
  gap: 14px;
}
#account-login {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}
#account-login input {
  width: 100%;
}
#account-login .btn {
  justify-content: center;
}

.custom-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.custom-rule-card {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 18px;
}
.custom-rule-card details {
  margin: 10px 0;
}
.crm-result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
}

.media-preview {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  background: #f7f8fa;
  margin: 12px 0;
}
.media-result {
  padding: 16px 0;
  border-bottom: 1px solid #e9eaed;
}
#clip-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
#clip-form label {
  display: grid;
  gap: 6px;
}
#clip-form input {
  width: 110px;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 8px;
}
