.demo-banner {
  padding: 10px 14px;
  border: 1px solid #dfdfe5;
  border-radius: 5px;
  margin: 0 0 20px;
  color: #64616c;
  background: #faf9fc;
  font-size: 12px;
}
.knowledge-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 28px;
}
.knowledge-heading h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -1.7px;
  margin: 8px 0 14px;
  max-width: 650px;
}
.knowledge-heading h1 > span {
  color: #bb6688;
}
.knowledge-heading p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 620px;
  margin: 0;
}
.knowledge-live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid #dcdde4;
  border-radius: 30px;
  white-space: nowrap;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}
.knowledge-live i {
  width: 6px;
  height: 6px;
  background: #8e66a2;
  border-radius: 50%;
}
.knowledge-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 23px;
  gap: 20px;
  box-shadow: none;
}
.knowledge-session strong {
  font-size: 14px;
}
.knowledge-session p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.knowledge-session-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.knowledge-session label {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 700;
  gap: 4px;
}
#knowledge-view select,
#knowledge-view input {
  padding: 10px 12px;
  border: 1px solid #cbc8d2;
  border-radius: 5px;
  background: #fff;
  min-height: 39px;
  font: inherit;
}
#knowledge-view .primary-button {
  min-height: 39px;
  padding: 10px 15px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
#knowledge-view .secondary-button {
  min-height: 39px;
  padding: 9px 12px;
  border: 1px solid #b7b2c1;
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
}
#knowledge-view button:disabled {
  opacity: 0.5;
  cursor: default;
}
.knowledge-status {
  min-height: 20px;
  margin: 15px 0 20px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.knowledge-status[data-kind='error'] {
  color: #98233c;
  background: #fff2f4;
  padding: 10px 14px;
  border-left: 3px solid #c44765;
}
.knowledge-status[data-kind='success'] {
  color: #21624d;
  background: #edf8f2;
  padding: 10px 14px;
  border-left: 3px solid #3d946f;
}
.knowledge-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.knowledge-search {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 430px;
}
.knowledge-search > span {
  position: absolute;
  font-size: 26px;
  top: 2px;
  left: 12px;
}
#knowledge-view .knowledge-search input {
  width: 100%;
  padding-left: 40px;
}
.knowledge-toolbar .muted {
  margin-right: auto;
  font-size: 12px;
  white-space: nowrap;
}
.knowledge-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  align-items: start;
  gap: 20px;
}
.knowledge-map,
.knowledge-editor {
  min-width: 0;
  box-shadow: 3px 3px 0 #ddd7e4;
  border-color: #c7c0d0;
}
.knowledge-map {
  padding: 0;
  overflow: hidden;
}
.knowledge-map-heading {
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid #e5e1ea;
}
.knowledge-zoom {
  display: flex;
  align-items: center;
  gap: 5px;
}
.knowledge-zoom button {
  border: 1px solid #d9d3e1;
  border-radius: 4px;
  height: 27px;
  min-width: 29px;
  font-size: 11px;
}
.knowledge-canvas {
  position: relative;
  background-color: #faf9fc;
  background-image: radial-gradient(#ddd7e3 1px, transparent 1px);
  background-size: 22px 22px;
}
#knowledge-graph {
  display: block;
  width: 100%;
  height: auto;
  min-height: 420px;
}
.knowledge-edge {
  stroke-width: 1.2;
  opacity: 0.55;
}
.knowledge-edge.is-connected {
  stroke-width: 2.4;
  opacity: 1;
}
.edge-requires {
  stroke: #b76c92;
  border-color: #b76c92;
}
.edge-related {
  stroke: #8f83b1;
  border-color: #8f83b1;
}
.edge-wikilink {
  stroke: #97a5b5;
  border-color: #97a5b5;
  stroke-dasharray: 5 4;
}
.knowledge-arrow-requires {
  fill: #b76c92;
}
.knowledge-arrow-related {
  fill: #8f83b1;
}
.knowledge-arrow-wikilink {
  fill: #97a5b5;
}
.knowledge-node {
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s;
}
.knowledge-node circle {
  stroke: #fff;
  stroke-width: 2.5px;
}
.knowledge-node .node-bundled {
  fill: #9784b1;
}
.knowledge-node .node-workspace {
  fill: #db91b1;
}
.knowledge-node text {
  font:
    12px 'DM Sans',
    sans-serif;
  fill: #54495f;
  stroke: #faf9fc;
  stroke-width: 4px;
  paint-order: stroke;
  stroke-linejoin: round;
  font-weight: 600;
}
.knowledge-node.is-selected circle,
.knowledge-node:focus circle {
  fill: #25212d;
  stroke: #eeb8d1;
  stroke-width: 5px;
}
.knowledge-node.is-selected text {
  fill: #231f2a;
  font-weight: 800;
}
.knowledge-node.is-muted {
  opacity: 0.42;
}
.knowledge-node:hover,
.knowledge-node:focus {
  opacity: 1;
}
.knowledge-node:hover circle {
  stroke: #d9c1e6;
  stroke-width: 5px;
}
#knowledge-empty {
  position: absolute;
  inset: 40% 20px auto;
  text-align: center;
  color: #6d6577;
}
.knowledge-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 15px 10px;
  border-top: 1px solid #e5e1ea;
  font-size: 10px;
  color: #655a71;
}
.knowledge-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.knowledge-legend i {
  width: 18px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
}
.knowledge-legend i.edge-wikilink {
  border-top-style: dashed;
}
.knowledge-map-footer {
  padding: 0 15px 15px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #8a8293;
  font-size: 9px;
}
.knowledge-list {
  border-top: 1px solid #e5e1ea;
  padding: 13px 18px;
}
.knowledge-list summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}
#knowledge-note-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  max-height: 200px;
  overflow: auto;
}
#knowledge-note-list button {
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f0edf3;
  padding: 9px 4px;
  color: #63576f;
  font-size: 11px;
}
#knowledge-note-list button:hover,
#knowledge-note-list button.is-selected {
  background: #f7edf4;
  color: #20162a;
}
.knowledge-editor {
  padding: 23px;
  min-height: 610px;
}
#knowledge-editor-empty {
  display: flex;
  min-height: 550px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.knowledge-empty-symbol {
  color: #cc95ae;
  font-size: 65px;
  line-height: 1;
  margin-bottom: 25px;
}
#knowledge-editor-empty h2 {
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.6px;
  max-width: 230px;
}
#knowledge-editor-empty p {
  max-width: 270px;
  font-size: 12px;
  line-height: 1.75;
  color: #766b80;
  margin-top: 8px;
}
#knowledge-editor-title {
  margin: 9px 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.7px;
  overflow-wrap: anywhere;
}
.knowledge-note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 9px;
  color: #796f83;
  margin: 12px 0;
}
.knowledge-note-meta > span {
  background: #f5f2f8;
  padding: 4px 7px;
  border-radius: 3px;
}
#knowledge-note-source {
  display: block;
  font-size: 11px;
  color: #816193;
  text-underline-offset: 3px;
  margin-bottom: 12px;
}
.knowledge-linked-notes {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
}
.knowledge-linked-notes button {
  border: 1px solid #e5dae9;
  color: #816193;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 11px;
}
.knowledge-editor-toolbar label {
  font-weight: 700;
}
.knowledge-editor-toolbar > span {
  color: #8f8797;
  font-size: 10px;
}
.knowledge-code {
  display: flex;
  border: 1px solid #ddd5e6;
  border-radius: 5px;
  overflow: hidden;
  background: #fcfaff;
  height: 365px;
}
#knowledge-line-numbers,
#knowledge-markdown {
  font:
    11px/1.9 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  margin: 0;
  padding: 12px 0;
  tab-size: 2;
}
#knowledge-line-numbers {
  flex: 0 0 38px;
  text-align: right;
  padding-right: 9px;
  overflow: hidden;
  user-select: none;
  color: #b0a7ba;
  background: #f4f0f8;
  border-right: 1px solid #e8e0ef;
}
#knowledge-markdown {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: #3d2e4c;
  white-space: pre;
  overflow: auto;
}
.knowledge-code:focus-within {
  border-color: #9d71b5;
  box-shadow: 0 0 0 2px #f0e5f5;
}
.knowledge-editor-hint {
  color: #8a7f93;
  font-size: 10px;
  line-height: 1.7;
}
.knowledge-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  margin-top: 15px;
  border-top: 1px solid #ece7f0;
}
#knowledge-dirty {
  color: #8a7f93;
  font-size: 10px;
}
.knowledge-save-note {
  font-size: 10px;
  color: #8a7f93;
  line-height: 1.7;
  margin-bottom: 0;
}
.knowledge-conflict {
  background: #fff7e8;
  border: 1px solid #e6c888;
  padding: 13px;
  margin-top: 14px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.6;
}
.knowledge-conflict .secondary-button {
  font-size: 10px !important;
  min-height: 30px !important;
  margin: 2px 4px 0 0;
}
#knowledge-new-dialog {
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100dvh - 50px);
  border: 2px solid #2b2231;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 6px 6px 0 #42324d;
}
#knowledge-new-dialog::backdrop {
  background: #21162766;
  backdrop-filter: blur(3px);
}
.knowledge-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.knowledge-dialog-heading h2 {
  margin: 6px 0 0;
  font-size: 26px;
  letter-spacing: -0.7px;
}
#knowledge-new-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  margin-bottom: 16px;
  font-weight: 650;
}
#knowledge-new-form small,
#knowledge-new-form p {
  font-weight: 400;
  color: #807487;
  font-size: 11px;
  line-height: 1.65;
}
#knowledge-view :focus-visible {
  outline: 2px solid #9d71b5;
  outline-offset: 3px;
}
@media (max-width: 1150px) {
  .knowledge-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.85fr);
    gap: 14px;
  }
  .knowledge-session {
    align-items: flex-start;
  }
  .knowledge-session-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 300px;
  }
  .knowledge-map-footer {
    flex-direction: column;
    align-items: center;
  }
  .knowledge-editor {
    padding: 18px;
  }
}
@media (max-width: 900px) {
  .knowledge-workbench {
    grid-template-columns: 1fr;
  }
  .knowledge-editor,
  #knowledge-editor-empty {
    min-height: 0;
  }
  #knowledge-editor-empty {
    padding: 30px 0;
  }
  #knowledge-graph {
    min-height: 360px;
    max-height: 570px;
  }
  .knowledge-heading {
    flex-direction: column;
    gap: 16px;
  }
  .knowledge-heading h1 {
    letter-spacing: -1px;
  }
  .knowledge-session {
    flex-direction: column;
  }
  .knowledge-session-actions {
    max-width: none;
    justify-content: flex-start;
    width: 100%;
  }
  .knowledge-toolbar {
    flex-wrap: wrap;
  }
  .knowledge-search {
    flex-basis: calc(100% - 150px);
    max-width: none;
  }
  .knowledge-toolbar .muted {
    flex: 1;
  }
}
@media (max-width: 500px) {
  .knowledge-session {
    padding: 16px;
  }
  .knowledge-search {
    flex-basis: 100%;
  }
  .knowledge-toolbar > select {
    max-width: 135px;
  }
  .knowledge-toolbar .primary-button {
    margin-left: auto;
  }
  #knowledge-graph {
    min-height: 310px;
  }
  .knowledge-legend {
    gap: 10px;
    font-size: 9px;
  }
  .knowledge-editor {
    padding: 16px;
  }
  .knowledge-session-actions {
    gap: 10px;
  }
  .knowledge-session-actions label {
    width: 100%;
  }
  #knowledge-new-dialog {
    padding: 20px;
  }
}

#knowledge-discard-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 2px solid #2b2231;
  border-radius: 8px;
  padding: 26px;
  box-shadow: 6px 6px 0 #42324d;
}
#knowledge-discard-dialog::backdrop {
  background: #21162766;
  backdrop-filter: blur(3px);
}
#knowledge-discard-dialog h2 {
  font-size: 24px;
  margin: 8px 0;
}
#knowledge-discard-dialog p {
  color: #766b80;
  font-size: 12px;
  line-height: 1.7;
}
.knowledge-discard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
