/* Caddie's shared document surface. Editing and reading use the same rhythm. */
:root {
  --doc-ink: #292d33;
  --doc-heading: #20242a;
  --doc-muted: #78818d;
  --doc-line: #e7eaf0;
  --doc-soft: #f6f8fb;
  --doc-blue: #3370ff;
  --doc-blue-soft: #edf3ff;
  --doc-font: "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --doc-mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo,
    Consolas, monospace;
  --doc-measure: 1160px;
  --doc-title-size: 36px;
  --doc-body-size: 16px;
  --doc-body-leading: 1.75;
  --doc-h1-size: 24px;
  --doc-h2-size: 21px;
  --doc-h3-size: 18px;
  --doc-h4-size: 16px;
}

:where(
  .knowledge-document-head,
  .knowledge-editor,
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body
) {
  width: min(100%, var(--doc-measure));
  margin-inline: auto;
}

.knowledge-document {
  background:
    radial-gradient(circle at 50% -10%, rgba(51,112,255,.035), transparent 28%),
    #fff;
}

.knowledge-document .knowledge-document-head {
  margin-bottom: 14px;
  padding: 38px 4px 22px;
  border-bottom: 0;
}

.knowledge-document .knowledge-document-head-main {
  gap: 9px;
}

.knowledge-document .knowledge-title-input {
  margin: 0;
  color: var(--doc-heading);
  font-family: var(--doc-font);
  font-size: var(--doc-title-size);
  font-weight: 720;
  line-height: 1.22;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.knowledge-document .knowledge-title-input::placeholder {
  color: #b2b8c0;
}

.knowledge-document .knowledge-title-input:focus {
  box-shadow: none;
}

.knowledge-document .knowledge-row-meta {
  gap: 8px 12px;
  color: #9198a2;
  font-size: 10.5px;
  line-height: 1.5;
}

.knowledge-document .knowledge-comment-trigger {
  display: inline-flex;
  height: 24px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #e2e6ec;
  border-radius: 6px;
  background: #fff;
  color: #69717d;
  font: 500 11px/1 var(--doc-font);
  cursor: pointer;
}

.knowledge-document .knowledge-comment-trigger:hover {
  border-color: #b8cafa;
  background: var(--doc-blue-soft);
  color: #245bdb;
}

.knowledge-comments-loading,
.knowledge-comments-empty {
  padding: 32px 12px;
  color: #8a929d;
  font: 400 13px/1.6 var(--doc-font);
  text-align: center;
}

.knowledge-comment-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #fff;
}

.knowledge-comment-composer blockquote,
.knowledge-comment-card blockquote {
  max-height: 120px;
  margin: 0;
  overflow: auto;
  padding: 8px 11px;
  border-left: 3px solid #8aa7ff;
  background: #f5f7ff;
  color: #69717d;
  font: 400 12px/1.6 var(--doc-font);
  white-space: pre-wrap;
}

.knowledge-comment-composer blockquote > span,
.knowledge-comment-card blockquote > span {
  display: block;
  margin-bottom: 4px;
  color: #7181a0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.knowledge-comment-composer > small {
  color: #9aa1aa;
  font: 400 10px/1.5 var(--doc-font);
}

.knowledge-comment-composer textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 11px;
  border: 0;
  outline: 0;
  color: var(--doc-ink);
  font: 400 14px/1.65 var(--doc-font);
}

.knowledge-comment-composer > div,
.knowledge-comment-card footer {
  display: flex;
  align-items: center;
  gap: 7px;
}

.knowledge-comment-composer > div > span {
  margin-right: auto;
  color: #9299a3;
  font: 400 11px/1 var(--doc-font);
}

.knowledge-comment-composer > div > button {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid #3370ff;
  border-radius: 6px;
  background: #3370ff;
  color: #fff;
  font: 650 10.5px/1 var(--doc-font);
  cursor: pointer;
}

.knowledge-comment-composer > div > button:hover {
  background: #2864eb;
}

.knowledge-comment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.knowledge-comment-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e6e9ee;
  border-radius: 10px;
  background: #fff;
}

.knowledge-comment-card.is-resolved {
  opacity: .66;
}

.knowledge-comment-card p {
  margin: 0;
  color: #343a43;
  font: 400 14px/1.65 var(--doc-font);
  white-space: pre-wrap;
}

.knowledge-comment-card footer time {
  margin-right: auto;
  color: #9aa1ab;
  font: 400 10.5px/1 var(--doc-font);
}

.knowledge-comment-card footer > span {
  color: #7d8590;
  font: 500 10.5px/1 var(--doc-font);
}

.knowledge-resolved-comments > summary {
  padding: 10px 4px;
  color: #7d8590;
  font: 500 12px/1.4 var(--doc-font);
  cursor: pointer;
}

.knowledge-resolved-comments .knowledge-comment-card + .knowledge-comment-card {
  margin-top: 10px;
}

.knowledge-document .knowledge-row-meta > span:not(.knowledge-mastery) {
  position: relative;
}

.knowledge-document .knowledge-row-meta > span:not(.knowledge-mastery) + span:not(.knowledge-mastery)::before {
  position: absolute;
  top: 50%;
  left: -7px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #b8bec7;
  content: "";
}

.knowledge-editor,
.knowledge-document-body,
.knowledge-editor-fallback,
.chat-document-body,
.knowledge-inline-body,
.selection-explain-reply,
.object-agent-final-content,
.iv-coach-prose,
.document-surface {
  color: var(--doc-ink);
  font-family: var(--doc-font);
  font-size: var(--doc-body-size);
  font-weight: 400;
  line-height: var(--doc-body-leading);
  letter-spacing: .005em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.knowledge-editor {
  min-height: 540px;
  padding-inline: 4px;
}

.knowledge-editor-fallback {
  min-height: 520px;
  padding: 10px 4px 110px;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) > :first-child {
  margin-top: 0;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) p {
  margin: .55em 0;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) :is(h1,h2,h3,h4) {
  color: var(--doc-heading);
  font-family: var(--doc-font);
  font-weight: 680;
  letter-spacing: -.025em;
  text-wrap: balance;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface
) h1 {
  margin: 1em 0 .38em;
  font-size: var(--doc-h1-size);
  line-height: 1.4;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface
) h2 {
  margin: .95em 0 .4em;
  font-size: var(--doc-h2-size);
  line-height: 1.42;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface
) h3 {
  margin: .9em 0 .36em;
  font-size: var(--doc-h3-size);
  line-height: 1.48;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface
) h4 {
  margin: .85em 0 .32em;
  font-size: var(--doc-h4-size);
  line-height: 1.55;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) :is(ul,ol) {
  margin: .62em 0 .78em;
  padding-left: 1.55em;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) li {
  margin: .28em 0;
  padding-left: .18em;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) blockquote {
  margin: .9em 0;
  padding: 11px 16px;
  border-left: 3px solid #7c9cff;
  border-radius: 0 8px 8px 0;
  background: #f7f9ff;
  color: #45516a;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) table {
  width: 100%;
  margin: 1em 0 1.2em;
  overflow: hidden;
  border: 1px solid #dfe4eb;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.55;
}

.caddie-table-scroll {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 1em 0 1.2em;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  border: 1px solid #dfe4eb;
  border-radius: 9px;
  background: #fff;
  scrollbar-color: #c7cfda transparent;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.caddie-table-scroll::-webkit-scrollbar {
  height: 7px;
}

.caddie-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.caddie-table-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c7cfda;
  background-clip: padding-box;
}

.caddie-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #9faab8;
  background-clip: padding-box;
}

.caddie-table-scroll:focus-visible {
  outline: 2px solid rgba(51,112,255,.34);
  outline-offset: 2px;
}

.caddie-table-scroll > table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.caddie-table-scroll :is(th,td) {
  min-width: 180px;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) :is(th,td) {
  padding: 9px 12px;
  border-right: 1px solid #e3e7ed;
  border-bottom: 1px solid #e3e7ed;
  text-align: left;
  vertical-align: top;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) th {
  background: #f5f7fa;
  color: #4b5563;
  font-weight: 620;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) tr:last-child td {
  border-bottom: 0;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) :is(th,td):last-child {
  border-right: 0;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) pre {
  margin: .9em 0 1.1em;
  overflow: auto;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #f7f8fa;
  color: #333943;
  font-family: var(--doc-mono);
  font-size: 13px;
  line-height: 1.65;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) :not(pre) > code {
  padding: .14em .38em;
  border-radius: 5px;
  background: #f1f3f6;
  color: #b42355;
  font-family: var(--doc-mono);
  font-size: .88em;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface,
  .chat-answer > .prose,
  .agent-chat-bubble > .prose,
  .knowledge-agent-msg .prose
) a {
  color: #245bdb;
  text-decoration-color: rgba(36,91,219,.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:where(
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface
) hr {
  height: 1px;
  margin: 1.8em 0;
  border: 0;
  background: var(--doc-line);
}

.knowledge-document :where(.knowledge-document-body,.knowledge-editor-fallback) ::selection,
.document-surface ::selection {
  background: #dbe7ff;
}

@media (max-width: 760px) {
  :root { --doc-measure: 100%; }

  .knowledge-document .knowledge-document-head {
    padding: 26px 0 16px;
  }

  .knowledge-document .knowledge-title-input {
    font-size: 27px;
  }

  .knowledge-editor,
  .knowledge-document-body,
  .knowledge-editor-fallback,
  .chat-document-body,
  .knowledge-inline-body,
  .selection-explain-reply,
  .object-agent-final-content,
  .iv-coach-prose,
  .document-surface {
    font-size: 14.5px;
    line-height: 1.74;
  }
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-document *,
  .document-surface * {
    scroll-behavior: auto !important;
  }
}

/* Shared document quote surface; explicit user colors remain authoritative. */
body .caddie-document-editor .bn-editor .bn-block-content[data-content-type="quote"],
body :is(.knowledge-document-body,.knowledge-editor-fallback,.chat-document-body,.knowledge-inline-body,.document-surface) blockquote {
  box-sizing:border-box; min-width:0; max-width:100%; margin-block:14px;
  padding:8px 16px; border:0; border-left:3px solid #d5d7da;
  border-radius:0; background:transparent; color:#64676d;
  line-height:inherit; overflow-wrap:anywhere; word-break:normal;
}
body .caddie-document-editor .bn-editor .bn-block-content[data-content-type="quote"] > blockquote {
  display:block; box-sizing:border-box; flex:1; min-width:0; width:100%;
  margin:0; padding:0; border:0; border-radius:0; background:transparent;
  color:inherit; font:inherit; white-space:pre-wrap; overflow-wrap:anywhere;
  word-break:normal; text-wrap:wrap;
}
body .caddie-document-editor .bn-editor .bn-block-content[data-content-type="quote"][data-text-color] { color:inherit; }
body .caddie-document-editor .bn-editor .bn-block-content[data-content-type="quote"][data-background-color] { background:inherit; }

/* One reading hierarchy in canonical, editable draft and streaming canvas. */
body .knowledge-document:not(.knowledge-pdf-document) :is(.knowledge-title-input,.knowledge-work-title,.knowledge-manuscript-title) {
  display:block; box-sizing:border-box; width:100%; min-width:0; max-width:100%;
  height:auto; resize:none; overflow:hidden; field-sizing:content;
  font-family:var(--reading-doc-font,var(--doc-font));
  font-size:clamp(26px,2.3vw,32px); font-weight:600; line-height:1.4;
  letter-spacing:0; white-space:pre-wrap; overflow-wrap:anywhere;
  text-wrap:pretty; padding:0; margin:0 0 16px;
}
body .knowledge-live-draft .knowledge-live-draft-body.document-surface {
  font-family:var(--reading-doc-font,var(--doc-font));
  font-size:var(--reading-doc-size,var(--doc-body-size));
  line-height:var(--reading-doc-leading,1.9); min-width:0; max-width:100%;
}
body .knowledge-live-draft-body.document-surface :is(p,li,blockquote) {
  font-family:inherit; font-size:inherit; line-height:inherit;
}
body .knowledge-live-draft .document-surface > .prose {font-family:inherit;font-size:inherit;line-height:inherit}
body .knowledge-live-draft-body.document-surface :is(h1,h2,h3,h4) {font-family:inherit;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
body .knowledge-live-draft-body.document-surface h1 {font-size:1.5em}
body .knowledge-live-draft-body.document-surface h2 {font-size:1.25em}
body .knowledge-live-draft-body.document-surface h3 {font-size:1.125em}
body .caddie-document-editor .bn-editor .bn-block-content[data-content-type="quote"] {
  line-height:var(--reading-doc-leading,var(--caddie-doc-body-leading,1.9));
}

/* Source association is context, not a second copy of the document. */
body .knowledge-thought-origin-top{flex-wrap:wrap}
body .knowledge-thought-origin-top>b{flex:1 1 200px}
body .knowledge-thought-origin-top>button{flex-shrink:0}
body .knowledge-origin-quote{margin:10px 0 8px;min-width:0}
body .knowledge-origin-quote>summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;padding:7px 0;color:#726581;font-size:12px;line-height:1.6}
body .knowledge-origin-quote>summary::-webkit-details-marker{display:none}
body .knowledge-origin-quote>summary>small{display:inline;color:inherit;font-size:11px;opacity:.8}
body .knowledge-origin-expand,body .knowledge-origin-collapse{margin-left:auto;font-size:11px}
body .knowledge-origin-collapse{display:none}
body .knowledge-origin-quote[open] .knowledge-origin-expand{display:none}
body .knowledge-origin-quote[open] .knowledge-origin-collapse{display:inline}
body .knowledge-origin-quote>summary>i{font-style:normal;font-size:15px}
body .knowledge-origin-quote[open]>summary>i{transform:rotate(180deg)}
body .knowledge-origin-quote>summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
body .knowledge-origin-quote-body{max-height:240px;overflow:auto;overscroll-behavior:contain;padding:4px 8px 8px 0;min-width:0;overflow-wrap:anywhere}
body .knowledge-origin-quote-body .prose{font-family:var(--doc-font);font-size:12px;line-height:1.7}
body .knowledge-origin-quote-body :is(h1,h2,h3,h4,h5,h6){font-size:13px;line-height:1.6;margin:12px 0 6px;font-weight:600}
body .knowledge-origin-quote-body :is(p,li,blockquote){font-size:12px;line-height:1.7;margin-block:6px}
body .knowledge-origin-quote-body table{font-size:11px}
body .knowledge-origin-quote-body :is(pre,.caddie-table-scroll){max-width:100%;overflow:auto}

/* Continuous document chrome: shared by knowledge and experience, not chat content. */
body :is(.knowledge-workspace,.project-page-shell){
  --document-rail:#f5f6f7;
  --document-divider:#ebedef;
  --document-rail-ink:#64676d;
  --document-rail-hover:#eceef0;
  --document-selected:#fff;
}
body .view:has(>#knowledgeList>.knowledge-library-workspace){padding:0;overflow:hidden;min-height:0}
body #knowledgeList:has(>.knowledge-library-workspace){height:100%;min-height:0}
body #knowledgeList>.knowledge-library-workspace:not(.focus-expanded){height:100%;min-height:0;border:0;border-radius:0;box-shadow:none;grid-template-rows:48px minmax(0,1fr)}
body :is(.knowledge-workspace-topbar,.project-workspace-toolbar,.compact-document-toolbar){
  min-height:48px;border-bottom:1px solid var(--document-divider,#e9edf2);background:#fff;box-shadow:none;
}
body .knowledge-workspace-topbar{padding-inline:14px;gap:16px;backdrop-filter:none}
body :is(.knowledge-document-back,.project-toolbar-left .project-back){border:0;background:transparent;box-shadow:none;border-radius:6px}
body .knowledge-workspace-topbar :is(.knowledge-topbar-action,.knowledge-more>summary){border-color:transparent;background:transparent;box-shadow:none}
body .knowledge-workspace-topbar .knowledge-topbar-action.on{background:var(--accent-soft);color:var(--accent-ink)}
body .knowledge-workspace-topbar :is(button,summary):hover{background:var(--document-rail-hover)}
body .knowledge-workspace :is(.knowledge-nav,.knowledge-outline-pane),
body .project-page-shell :is(.project-nav,.project-side-shell){background:var(--document-rail);border-color:var(--document-divider);box-shadow:none;border-radius:0}
body .knowledge-workspace .knowledge-outline-pane,
body .project-page-shell .project-side-shell{background:#fff}
body .knowledge-workspace .knowledge-nav-head{height:48px;min-height:48px;padding:0 14px;background:transparent;border-color:var(--document-divider)}
body .knowledge-workspace .knowledge-nav-head b{font-size:12px;font-weight:600;color:#373a40}
body .knowledge-workspace .knowledge-nav-head span{font-size:10px;color:#81858d}
body .knowledge-workspace .knowledge-workspace-tree-context{padding:9px 14px;background:transparent;border:0;display:flex;align-items:center;gap:8px}
body .knowledge-workspace .knowledge-workspace-tree-context span{font-size:10px;font-weight:500;color:#81858d}
body .knowledge-workspace .knowledge-workspace-tree-context small{display:none}
body .knowledge-workspace .knowledge-workspace-tree{padding:2px 8px 24px}
body .knowledge-workspace .knowledge-topic-link{box-shadow:none;border-color:transparent;background:transparent;min-height:34px;border-radius:6px}
body .knowledge-workspace .knowledge-topic-link.on{box-shadow:none;background:var(--document-rail-hover)}
body .knowledge-workspace .knowledge-topic-link:hover{background:var(--document-rail-hover)}
body .knowledge-workspace .knowledge-topic-link b{font-size:12px;font-weight:600}
body .knowledge-workspace .knowledge-folder-node.on>.knowledge-folder-row .knowledge-folder-link{background:transparent;box-shadow:none;border-radius:5px}
body .knowledge-workspace .knowledge-folder-doc-branch>button{height:32px;border-radius:5px;color:var(--document-rail-ink)}
body .knowledge-workspace .knowledge-folder-doc-branch>button>span{font-size:12px}
body .knowledge-workspace .knowledge-folder-doc-branch>button>em{background:transparent;color:#81858d;font-size:9px;font-weight:400}
body .knowledge-workspace .knowledge-folder-doc-branch.on>button{background:var(--document-selected);color:var(--accent-ink);box-shadow:inset 2px 0 0 var(--accent)}
body .knowledge-workspace .knowledge-folder-doc-branch>button:hover{background:var(--document-rail-hover)}
body .knowledge-workspace .knowledge-outline-pane{padding:0}
body :is(.knowledge-outline-body,#projectContextIndex){padding:8px 10px 24px;scrollbar-width:thin;scrollbar-color:#d6dce5 transparent}
body :is(.knowledge-outline-body,#projectContextIndex) .project-index-row{border-radius:5px;background:transparent;margin-block:2px;box-shadow:none}
body :is(.knowledge-outline-body,#projectContextIndex) .project-index-row:hover{background:var(--document-rail-hover,#f0f3f7)}
body :is(.knowledge-outline-body,#projectContextIndex) .project-index-row.on{background:transparent;box-shadow:inset 2px 0 0 var(--accent);border-radius:0}
body :is(.knowledge-outline-body,#projectContextIndex) .project-index-link{color:var(--document-rail-ink,#64676d);font-size:12px;line-height:1.65;font-weight:400;padding-block:6px;overflow-wrap:anywhere}
body :is(.knowledge-outline-body,#projectContextIndex) .project-index-row.on .project-index-link{color:var(--accent-ink);font-weight:600}
body :is(.knowledge-outline-body,#projectContextIndex) .project-index-caret{background:transparent;color:#8d98a7}
body .knowledge-workspace>.knowledge-resizer{background:transparent;touch-action:none;z-index:3}
body .knowledge-workspace>.knowledge-resizer span{inset:0 auto 0 2px;width:1px;background:var(--document-divider)}
body .knowledge-workspace>.knowledge-resizer:hover span,body.is-column-resizing .knowledge-workspace>.knowledge-resizer.is-active span{width:2px;background:var(--accent)}
body .knowledge-workspace>.knowledge-resizer::after{content:"";position:absolute;inset:0 -3px;cursor:col-resize}
body .knowledge-workspace>.knowledge-document:not(.knowledge-pdf-document){padding:0 clamp(24px,2.4vw,40px) 48px;background:#fff}
body .knowledge-workspace .knowledge-document:not(.knowledge-pdf-document) .knowledge-document-head{padding:24px 0 12px!important;margin-bottom:18px!important;border-bottom:0!important}
body .knowledge-workspace .knowledge-title-input{letter-spacing:0;line-height:1.4;margin-bottom:14px}
body .knowledge-workspace .knowledge-row-meta{color:#81858d;line-height:1.6}
body .knowledge-workspace .knowledge-editor{padding-inline:0;max-width:var(--doc-measure)}
body .knowledge-workspace .knowledge-editor .bn-editor{padding-inline:0!important}
body .knowledge-workspace .knowledge-thought-origin{margin:0 0 18px;padding:10px 14px;border:0;border-left:2px solid #dfe1e5;background:#f8f9fa;border-radius:0;box-shadow:none;color:#64676d}
body .knowledge-workspace .knowledge-thought-origin-top{gap:8px}
body .knowledge-workspace .knowledge-thought-origin-top>b{color:#4b4f56;font-weight:500}
body .knowledge-workspace .knowledge-thought-origin-top>span{background:#eceef0;color:#64676d}
body .knowledge-workspace .knowledge-thought-origin-top>button,
body .knowledge-workspace .knowledge-origin-quote>summary{color:#64676d}
body .knowledge-workspace .knowledge-thought-origin-top>button:hover{color:var(--accent-ink)}
body .knowledge-workspace .knowledge-thought-origin>blockquote{color:#64676d;border-left-color:#d5d7da}
body .project-page-shell .project-view-switcher{background:#eceef0}
body .project-page-shell .project-doc-item.on{background:#fff;border-color:#e5e7eb;color:var(--accent-ink);box-shadow:inset 2px 0 0 var(--accent)}
/* Document rhythm, not a theme replacement. User font/size recipes stay authoritative. */
body :is(.knowledge-document,.project-page-shell) .caddie-document-editor .bn-editor{letter-spacing:0}
html:not([data-caddie-reading]) body :is(.knowledge-document,.project-page-shell) .caddie-document-editor{--caddie-doc-body-leading:1.75}
html:not([data-caddie-reading]) body :is(.knowledge-document,.project-page-shell) .caddie-document-editor .bn-editor{line-height:1.75!important}
body :is(.knowledge-document,.project-page-shell) .caddie-document-editor .bn-block-content[data-content-type="paragraph"]{padding-block:2px}
body :is(.knowledge-document,.project-page-shell) .caddie-document-editor .bn-block-content[data-content-type="heading"][data-level="1"]{margin-top:24px;margin-bottom:8px}
body :is(.knowledge-document,.project-page-shell) .caddie-document-editor .bn-block-content[data-content-type="heading"][data-level="2"]{margin-top:20px;margin-bottom:6px}
/* Bound source snapshots in already-cached app shells until their next safe reload. */
body .knowledge-workspace .knowledge-thought-origin>blockquote{max-height:96px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;white-space:normal;overflow-wrap:anywhere;padding-right:8px}
body .knowledge-workspace .knowledge-origin-quote{margin:5px 0 2px}
body .knowledge-workspace .knowledge-origin-quote>summary{padding-block:4px}
body .knowledge-workspace .knowledge-child-origin{padding:10px 14px;border-radius:6px;background:var(--document-rail);border-color:var(--document-divider);box-shadow:none}
@media(max-width:1000px){
  body .knowledge-workspace>.knowledge-document:not(.knowledge-pdf-document){padding-inline:22px}
  body .knowledge-workspace-topbar{gap:8px;padding-inline:10px}
  body .knowledge-workspace-location{gap:6px}
}
@media(max-width:760px){
  body .view:has(>#knowledgeList>.knowledge-library-workspace){overflow:auto}
  body .knowledge-workspace>.knowledge-document:not(.knowledge-pdf-document){padding-inline:20px}
  body .knowledge-workspace-topbar .knowledge-save-state{display:none}
}
