.knowledge-nav {
  padding-left: 12px;
}
.knowledge-nav .navitem {
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}
.page.knowledge-page {
  max-width: 1200px;
  height: calc(100dvh - 66px);
  padding: 28px 32px;
}
.knowledge-surface {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 20px;
  overflow: auto;
}
.knowledge-card {
  border: 1px solid #e6e8e7;
  border-radius: 18px;
  padding: 24px;
  background: #fff;
}
.knowledge-card > img {
  width: 30px;
  height: 30px;
  padding: 9px;
  box-sizing: content-box;
  background: #edf8f2;
  border-radius: 12px;
}
.knowledge-card h2 {
  font-size: 18px;
  margin: 16px 0 8px;
}
.knowledge-card p {
  min-height: 38px;
}
.knowledge-card .actions {
  margin-top: 18px;
}
.knowledge-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 6px 0 22px;
  border-bottom: 1px solid #eee;
}
.knowledge-title {
  font-size: 22px;
  font-weight: 650;
}
.knowledge-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.knowledge-history {
  padding: 20px 14px 20px 0;
  border-right: 1px solid #eee;
  overflow: auto;
}
.knowledge-history h3 {
  font-size: 12px;
  font-weight: 500;
  color: #87918b;
  margin: 0 8px 14px;
}
.knowledge-history-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 4px 0;
}
.knowledge-history-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-history-open.selected,
.knowledge-history-open:hover {
  background: #edf3ef;
}
.knowledge-history-row .icon-button {
  width: 26px;
  height: 28px;
  opacity: 0.65;
}
.knowledge-chat {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-left: 26px;
}
.knowledge-messages {
  flex: 1;
  overflow: auto;
  padding: 24px 8px 28px;
  scroll-behavior: smooth;
}
.knowledge-question {
  max-width: 85%;
  width: fit-content;
  margin: 10px 0 25px auto;
  padding: 13px 18px;
  border-radius: 20px;
  background: #f0f3f1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.knowledge-answer {
  margin-bottom: 32px;
  overflow-wrap: anywhere;
}
.knowledge-answer > strong {
  display: block;
  font-size: 14px;
  margin-bottom: 12px;
}
.knowledge-answer > small {
  display: block;
  margin-top: 12px;
  font-size: 11px;
}
.knowledge-answer .markdown {
  font-size: 14px;
  line-height: 1.85;
}
.knowledge-empty {
  color: #768079;
  text-align: center;
  margin: 80px 0;
}
.knowledge-composer {
  border: 1px solid #dce5df;
  box-shadow: 0 5px 18px #173c2310;
  border-radius: 22px;
  padding: 15px 18px;
  background: white;
  margin-bottom: 10px;
}
.knowledge-composer > .field > span,
.knowledge-composer .actions .field > span {
  display: none;
}
.knowledge-composer textarea {
  resize: none;
  border: 0 !important;
  box-shadow: none !important;
  width: 100%;
  padding: 0;
  outline: none;
  background: none;
}
.knowledge-composer .actions {
  display: flex;
  align-items: center;
  margin: 8px 0;
}
.knowledge-composer .field {
  margin: 0;
}
.knowledge-composer select {
  border: 0;
  font-size: 12px;
  max-width: 260px;
  padding: 7px;
}
.knowledge-composer .actions .field {
  margin-right: auto;
}
.knowledge-composer > small {
  font-size: 11px;
}
.knowledge-composer .primary {
  background: #138c58;
  border-color: #138c58;
}
.knowledge-citation {
  display: inline;
  color: #138c58;
  background: #eaf5ef;
  border: 0;
  border-radius: 5px;
  padding: 0 4px;
  font-size: 11px;
  vertical-align: baseline;
  margin: 0 2px;
}
.knowledge-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.knowledge-source {
  font-size: 11px;
  color: #50705c;
  border: 1px solid #e1e9e4;
  border-radius: 7px;
  background: #fafcfb;
  padding: 6px 10px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.knowledge-preview {
  position: fixed;
  z-index: 1100;
  right: 12px;
  top: 14px;
  bottom: 14px;
  width: min(550px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 18px;
  box-shadow: 0 8px 40px #0002;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: knowledge-slide 0.2s ease-out;
  box-sizing: border-box;
}
.knowledge-preview .actions {
  display: flex;
  justify-content: space-between;
}
.knowledge-preview strong {
  overflow-wrap: anywhere;
}
.knowledge-source-text {
  flex: 1;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.85 system-ui;
  background: #fafbfa;
  border-radius: 10px;
  padding: 16px;
  margin: 0;
}
.knowledge-preview > a {
  width: fit-content;
}
.knowledge-members {
  border: 1px solid #e5e7e5;
  border-radius: 10px;
  max-height: 240px;
  overflow: auto;
  padding: 14px;
}
.knowledge-members label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px 0;
}
.knowledge-members input {
  width: auto;
}
.knowledge-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.knowledge-notice {
  padding: 12px 18px;
  border-radius: 10px;
  background: #f7f0df;
  color: #785e25;
}
.knowledge-management {
  min-width: min(700px, 75vw);
}
@keyframes knowledge-slide {
  from {
    transform: translateX(60px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@media (max-width: 800px) {
  .page.knowledge-page {
    padding: 18px 14px;
  }
  .knowledge-layout {
    grid-template-columns: 1fr;
  }
  .knowledge-history {
    max-height: 115px;
    border-right: 0;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    display: flex;
    gap: 8px;
  }
  .knowledge-history h3 {
    display: none;
  }
  .knowledge-history-row {
    min-width: 140px;
    max-width: 210px;
  }
  .knowledge-chat {
    padding-left: 0;
  }
  .knowledge-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .knowledge-title {
    font-size: 19px;
  }
  .knowledge-composer select {
    max-width: 170px;
  }
  .knowledge-management {
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-preview {
    animation: none;
  }
  .knowledge-messages {
    scroll-behavior: auto;
  }
}
.page.knowledge-page {
  margin: 0 auto;
  width: 100%;
  max-height: calc(100dvh - 64px);
}
.knowledge-composer .field > span {
  display: none;
}
.knowledge-composer .field textarea {
  min-height: 54px;
  max-height: 160px;
}
.knowledge-composer .row-actions {
  display: flex;
  align-items: center;
  margin: 8px 0;
}
.knowledge-composer .row-actions .field {
  margin-right: auto;
}
.knowledge-header .row-actions {
  margin: 0;
  flex-wrap: wrap;
}
.knowledge-card .row-actions {
  margin-top: 18px;
}
.knowledge-preview .row-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.knowledge-quote-highlight{background:#fff19c;color:inherit;box-decoration-break:clone;-webkit-box-decoration-break:clone;border-radius:2px;padding:1px 0;scroll-margin-top:24px}
.knowledge-visibility-picker{border:1px solid var(--border,#e7e7e7);border-radius:12px;padding:14px}.knowledge-visibility-columns{display:grid;grid-template-columns:1fr 1fr;min-height:260px}.knowledge-visibility-left{border-right:1px solid var(--border,#e7e7e7);padding-right:12px}.knowledge-visibility-left>input{width:100%;box-sizing:border-box;margin-bottom:10px;padding:9px 11px;border:1px solid var(--border,#ddd);border-radius:8px}.knowledge-visibility-right{padding-left:14px}.knowledge-directory-picker{max-height:250px;overflow:auto}.knowledge-directory-row,.knowledge-directory-member,.knowledge-selected-row{display:flex;align-items:center;min-height:34px;gap:5px}.knowledge-picker-item{display:flex;align-items:center;gap:7px;border:0;background:transparent;padding:6px 7px;border-radius:7px;text-align:left;flex:1;color:inherit}.knowledge-picker-item:hover{background:#f1f5f3}.knowledge-picker-item>.icon:last-child{margin-left:auto;color:#27805c}.knowledge-selected-row{justify-content:space-between;padding:5px 0}.knowledge-selected-row>.icon{margin-right:6px}.knowledge-selected-row>span{flex:1}.knowledge-selected-row .icon-button{width:24px;height:24px;padding:4px}
@media(max-width:640px){.knowledge-visibility-columns{grid-template-columns:1fr}.knowledge-visibility-left{border-right:0;border-bottom:1px solid var(--border,#e7e7e7);padding:0 0 12px}.knowledge-visibility-right{padding:12px 0 0}}
.knowledge-visibility-picker[hidden]{display:none}
.knowledge-visibility-columns{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.knowledge-visibility-left,.knowledge-visibility-right{min-width:0}
.knowledge-directory-picker,.knowledge-selected-list{max-height:260px;overflow:auto;overscroll-behavior:contain}
.knowledge-directory-picker>.knowledge-picker-item{width:100%;box-sizing:border-box}
.knowledge-picker-item{min-width:0;width:100%;font-size:13px;line-height:1.4}
.knowledge-picker-item[aria-pressed=true]{background:#eef6f1}
.knowledge-picker-item>.icon,.knowledge-selected-row>.icon{flex:none;width:16px;height:16px}
.knowledge-picker-identity{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1;text-align:left}
.knowledge-picker-name{overflow-wrap:anywhere}
.knowledge-picker-identity small{font-size:11px;line-height:1.5;color:#888;overflow-wrap:anywhere}
.knowledge-picker-count{font-size:12px;color:#777;margin:0 0 12px}
.knowledge-picker-empty{font-size:12px;line-height:1.6;color:#999;padding:8px 4px;margin:0}
.knowledge-picker-expand{display:grid;place-items:center;flex:none;width:18px;height:28px;min-height:0;padding:0;border:0;background:transparent}
.knowledge-picker-expand>.icon{width:13px;height:13px}
.knowledge-picker-expand>span{display:none}
.knowledge-picker-expand:disabled{visibility:hidden}
.knowledge-selected-row .icon-button{display:grid;place-items:center;flex:none;min-height:0}
.knowledge-selected-row .icon-button>span{display:none}
.knowledge-selected-row .icon-button>.icon{width:14px;height:14px}
@media(max-width:640px){.knowledge-visibility-columns{grid-template-columns:minmax(0,1fr)}}
