.knowledge-numeric-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(4px);
}

.knowledge-numeric-dialog {
  width: min(100%, 420px);
  border: 1px solid #dce7f3;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 56px rgba(35, 63, 97, 0.18);
  padding: 18px 18px 16px;
}

.knowledge-numeric-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.knowledge-numeric-dialog-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  color: #27364a;
}

.knowledge-numeric-dialog-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f3f7fb;
  color: #7b8ca0;
  font-size: 26px;
  line-height: 1;
  padding: 0;
}

.knowledge-numeric-dialog-form {
  display: grid;
  gap: 14px;
}

.knowledge-numeric-dialog-message {
  color: #6d7f91;
  font-size: 14px;
  line-height: 1.45;
}

.knowledge-numeric-dialog-field {
  display: grid;
  gap: 7px;
}

.knowledge-numeric-dialog-field span {
  color: #607387;
  font-size: 13px;
  font-weight: 600;
}

.knowledge-numeric-dialog-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8e4f0;
  border-radius: 14px;
  background: #f8fbfe;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: #26364a;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.knowledge-numeric-dialog-field input:focus {
  border-color: #9ec1ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 115, 255, 0.08);
}

.knowledge-numeric-dialog-error {
  color: #cc4b63;
  font-size: 13px;
  line-height: 1.4;
}

.knowledge-numeric-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.knowledge-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 70vh;
}

.knowledge-sidebar,
.knowledge-content {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid #e7edf5;
  border-radius: 20px;
  padding: 18px;
  min-height: 0;
  box-shadow: 0 10px 30px rgba(37, 78, 122, 0.06);
}

.knowledge-sidebar {
  overflow: auto;
  background: linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
}

.knowledge-sidebar-toolbar,
.knowledge-document-actions {
  display: flex;
  gap: 8px;
}

.knowledge-sidebar-toolbar {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.knowledge-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 188px;
  min-height: 20px;
  padding: 5px 12px;
  border: 1px solid #dce7f3;
  border-radius: 999px;
  background: #f6fafc;
}

.knowledge-search-icon {
  color: #a3afbe;
  font-size: 12px;
}

.knowledge-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
  color: #6d7f91;
}

.knowledge-create-wrap {
  position: relative;
  flex: 0 0 auto;
}

.knowledge-create-toggle {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1d73ff;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.knowledge-create-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid #e8eef6;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(41, 74, 119, 0.16);
  display: grid;
  gap: 4px;
  z-index: 40;
}

.knowledge-create-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #3f4349;
  font-size: 17px;
  text-align: left;
}

.knowledge-create-menu-item:hover {
  background: #f4f8ff;
}

.knowledge-create-menu-icon {
  width: 22px;
  height: 22px;
  color: #95a3b3;
}

.knowledge-tree-shell {
  padding: 6px 0;
}

.knowledge-search-results {
  display: grid;
  gap: 8px;
}

.knowledge-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #deebfb;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
  color: #2f4358;
  text-align: left;
}

.knowledge-search-result:hover {
  background: linear-gradient(180deg, #eef6ff 0%, #e4efff 100%);
}

.knowledge-search-result-title {
  font-weight: 500;
  line-height: 1.2;
}

.knowledge-search-empty {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f9fc;
  color: #7c8ea3;
  font-size: 14px;
}

.knowledge-tree-node {
  margin-bottom: 6px;
}

.knowledge-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: calc(var(--kb-depth, 0) * 16px);
}

.knowledge-tree-folder,
.knowledge-tree-document {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.knowledge-tree-folder.active,
.knowledge-tree-document.active {
  border-color: #d7e6fb;
  background: linear-gradient(180deg, #edf5ff 0%, #e7f1ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.knowledge-tree-folder:hover,
.knowledge-tree-document:hover {
  background: rgba(235, 244, 255, 0.74);
  transform: translateX(1px);
}

.knowledge-tree-title-input,
.knowledge-document-title-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  box-shadow: inset 0 1px 2px rgba(34, 65, 102, 0.04);
}

.knowledge-tree-document {
  cursor: pointer;
  text-align: left;
}

.knowledge-tree-folder {
  cursor: pointer;
  text-align: left;
}

.knowledge-tree-label {
  font-weight: 600;
  color: #33475b;
}

.knowledge-tree-document span:last-child,
.knowledge-folder-document-item span:last-child {
  font-weight: 500;
  line-height: 1.18;
}

.knowledge-tree-folder > .knowledge-tree-label,
.knowledge-tree-document > span:last-child {
  min-width: 0;
}

.knowledge-tree-icon,
.knowledge-search-result-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #97a6b6;
}

.knowledge-tree-toggle {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #97a6b6;
  cursor: pointer;
}

.knowledge-tree-toggle:hover {
  color: #6f8296;
}

.knowledge-tree-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
}

.knowledge-tree-icon svg,
.knowledge-search-result-icon svg,
.knowledge-create-menu-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.knowledge-document {
  display: grid;
  gap: 14px;
  padding: 6px 4px;
}

.knowledge-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #7f93a8;
  font-size: 13px;
}

.knowledge-breadcrumb {
  white-space: nowrap;
}

.knowledge-breadcrumb-separator {
  color: #b0bfd0;
}

.knowledge-document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.knowledge-document-header h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.knowledge-editor-shell,
.knowledge-document-content {
  min-height: 420px;
  border: 1px solid #e7edf5;
  border-radius: 18px;
  background: #fff;
  overflow: visible;
  box-shadow: 0 8px 24px rgba(33, 74, 118, 0.05);
}

.knowledge-document-content {
  padding: 16px;
  line-height: 1.7;
}

.knowledge-editor-textarea {
  min-height: 420px;
  width: 100%;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.knowledge-editor-shell .tox-tinymce {
  border: 0;
  border-radius: 18px;
  overflow: visible;
}

.knowledge-editor-shell .tox .tox-editor-container,
.knowledge-editor-shell .tox .tox-sidebar-wrap,
.knowledge-editor-shell .tox .tox-edit-area {
  overflow: visible;
}

.knowledge-editor-shell .tox .tox-toolbar,
.knowledge-editor-shell .tox .tox-toolbar__primary,
.knowledge-editor-shell .tox .tox-editor-header {
  background: linear-gradient(180deg, #fdfefe 0%, #f5f9ff 100%);
}

.knowledge-editor-shell .tox .tox-editor-header {
  position: sticky !important;
  top: 0;
  z-index: 120;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 8px 18px rgba(33, 74, 118, 0.08);
}

.knowledge-editor-shell .tox .tox-edit-area__iframe {
  background: #fff;
}

.knowledge-document-content p,
.tox-edit-area iframe,
.knowledge-editor-shell p {
  margin: 0 0 16px;
}

.knowledge-document-content h2,
.knowledge-editor-shell h2 {
  margin: 20px 0 12px;
  font-size: 24px;
  line-height: 1.2;
}

.knowledge-document-content h3,
.knowledge-editor-shell h3 {
  margin: 18px 0 10px;
  font-size: 19px;
  line-height: 1.3;
}

.knowledge-document-content ul,
.knowledge-document-content ol,
.knowledge-editor-shell ul,
.knowledge-editor-shell ol {
  margin: 0 0 12px 20px;
}

.knowledge-document-content blockquote,
.knowledge-editor-shell blockquote {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--text-soft);
}

.knowledge-document-content a,
.knowledge-editor-shell a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.knowledge-document-content .knowledge-inline-document-link,
.knowledge-editor-shell .knowledge-inline-document-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.knowledge-inline-document-link::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #97a6b6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true'%3E%3Cpath d='M7 3.5h7l4 4V19a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 6 19V5A1.5 1.5 0 0 1 7.5 3.5Z' fill='none' stroke='%2397a6b6' stroke-width='1.7' stroke-linejoin='round'/%3E%3Cpath d='M14 3.8V8h4.1' stroke='%2397a6b6' stroke-width='1.7' stroke-linejoin='round'/%3E%3Cpath d='M8.5 11.2h7M8.5 14.2h7M8.5 17.2h5.2' stroke='%2397a6b6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.knowledge-document-content img,
.knowledge-document-content video,
.knowledge-document-content iframe,
.knowledge-document-content audio {
  max-width: 100%;
  height: auto;
}

.knowledge-panel-card {
  border: 1px solid #e7edf5;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(33, 74, 118, 0.04);
}

.knowledge-section-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #42566b;
}

.knowledge-document-content mark,
.knowledge-editor-shell mark {
  background: #fff3a1;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.knowledge-toggle-block {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--accent) 12%);
  overflow: hidden;
}

.knowledge-toggle-block summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  user-select: none;
}

.knowledge-toggle-block > div {
  padding: 0 12px 12px;
}

.knowledge-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #dfe9f5;
  background: #eaf5ff;
}

.knowledge-callout__icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  border: 1.5px solid currentColor;
}

.knowledge-callout__body {
  flex: 1;
  min-width: 0;
}

.knowledge-callout__body > :last-child {
  margin-bottom: 0;
}

.knowledge-callout--info {
  background: #eaf5ff;
  border-color: #d7e9ff;
}

.knowledge-callout--info .knowledge-callout__icon {
  color: #1677ff;
}

.knowledge-callout--success {
  background: #dcf9ec;
  border-color: #bcefd8;
}

.knowledge-callout--success .knowledge-callout__icon {
  color: #2ba86f;
}

.knowledge-callout--danger {
  background: #fde9ec;
  border-color: #f6ccd5;
}

.knowledge-callout--danger .knowledge-callout__icon {
  color: #e05a73;
}

.knowledge-callout--warning {
  background: #fff4cf;
  border-color: #f7e5a6;
}

.knowledge-callout--warning .knowledge-callout__icon {
  color: #d3a126;
}

.knowledge-access-box {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.knowledge-access-title {
  font-size: 12px;
  color: #7f93a8;
  margin-bottom: 6px;
}

.knowledge-access-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
}

.knowledge-access-item input {
  margin: 0;
}

.knowledge-folder-documents {
  display: grid;
  gap: 8px;
}

.knowledge-folder-document-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
  color: #33475b;
  text-align: left;
}

.knowledge-folder-document-item:hover {
  background: #f7fbff;
}

.knowledge-folder-empty {
  color: #7f93a8;
  font-size: 14px;
}
