/* Knowledge workspace: full-height columns with independent scroll ownership. */
.ps-knowledge-mode .ps-domain-chip {position:relative;box-shadow:none;border-radius:5px}
.ps-knowledge-mode .ps-domain-chip:hover,.ps-knowledge-mode .ps-domain-chip:focus-within {background:var(--ps-soft,#f1f4f8)}
body.studio-page .ps-knowledge-mode .ps-k-categories [data-ps-domain],
body.studio-page .ps-knowledge-mode .ps-k-categories > [data-ps-clear-domain] {text-align:left!important;padding:10px 66px 10px 28px!important;min-height:44px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.studio-page .ps-knowledge-mode .ps-k-categories [data-ps-domain-delete],
body.studio-page .ps-knowledge-mode .ps-k-categories [data-ps-domain-edit] {position:absolute;right:4px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:27px;min-height:28px;padding:4px;opacity:0;pointer-events:none;color:var(--ps-muted)!important}
body.studio-page .ps-knowledge-mode .ps-k-categories [data-ps-domain-delete] {right:33px}
.ps-knowledge-mode .ps-domain-chip :is([data-ps-domain-delete],[data-ps-domain-edit]) svg {width:17px;height:17px}
body.studio-page .ps-knowledge-mode .ps-domain-chip:is(:hover,:focus-within) :is([data-ps-domain-delete],[data-ps-domain-edit]) {opacity:1;pointer-events:auto}
.ps-knowledge-mode .ps-domain-chip::after {content:'⠿';position:absolute;left:7px;top:50%;transform:translateY(-50%);color:var(--ps-muted);opacity:0;pointer-events:none}
.ps-knowledge-mode .ps-domain-chip:is(:hover,:focus-within)::after {opacity:1}
@media(hover:none) {body.studio-page .ps-knowledge-mode .ps-k-categories :is([data-ps-domain-delete],[data-ps-domain-edit]) {opacity:1;pointer-events:auto}}
@media(min-width:1181px) {
 body.private-view:has(.ps-knowledge-mode) {overflow:hidden}
 body.private-view #private-study-root > .ps-app.ps-knowledge-mode {position:fixed;inset:var(--studio-nav-height,70px) 0 0;display:grid;grid-template-columns:188px minmax(0,1fr);height:calc(100dvh - var(--studio-nav-height,70px));min-height:0;overflow:hidden;background:var(--ps-bg,#f4f7fc)}
 body.private-view .ps-knowledge-mode > .ps-sidebar {position:static;top:auto;height:100%;min-height:0;padding:18px 15px 20px;border-right:0;overflow-y:auto}
 body.private-view .ps-knowledge-mode > .ps-sidebar nav {gap:7px}
 body.private-view .ps-knowledge-mode > .ps-sidebar nav button {min-height:48px;text-align:left}
 body.private-view .ps-knowledge-mode .ps-sidebar-lamp {display:none}
 body.private-view #private-study-root > .ps-app.ps-knowledge-mode > main.ps-content {height:100%;min-height:0;overflow:hidden;padding:18px 16px 0 14px!important;background:var(--ps-bg,#f4f7fc)}
 .ps-knowledge-mode .ps-knowledge-workspace {height:100%;min-height:0;grid-template-columns:218px minmax(0,1fr);align-items:stretch;gap:14px}
 .ps-knowledge-mode .ps-knowledge-workspace > .ps-k-category-bar {position:static;top:auto;width:auto;margin:0;height:100%;min-height:0;padding:8px;border:0;border-radius:7px 7px 0 0;background:var(--ps-paper);overflow:hidden}
 .ps-knowledge-mode .ps-k-domain-tools {height:42px;flex:none;margin-bottom:14px}
 .ps-knowledge-mode .ps-k-domain-tools .ps-search {padding:6px;min-height:38px}
 .ps-knowledge-mode .ps-knowledge-workspace > .ps-k-layout {height:100%;min-height:0;padding:0;grid-template-columns:minmax(0,1.4fr) minmax(300px,1fr);align-items:stretch;gap:14px;overflow:hidden}
 .ps-app.ps-knowledge-mode .ps-k-layout > :is(.ps-k-list,.ps-k-detail) {position:static;height:100%;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-width:thin;border:0!important;border-radius:7px 7px 0 0;box-shadow:none;padding:10px 16px 32px;background:var(--ps-paper)}
 .ps-knowledge-mode .ps-k-list > * {flex-shrink:0}
 .ps-knowledge-mode .ps-k-tools .ps-k-search {max-width:none}
 .ps-knowledge-mode .ps-k-detail .ps-k-title {margin-top:0}
 .ps-knowledge-mode .ps-k-entry:has(.ps-k-row[data-selected='true']) {background:var(--ps-chip-selected,#eef5ff);border-radius:5px}
 .ps-knowledge-mode .ps-k-group > h2 {display:none}
 .ps-knowledge-mode > .ps-content > :is(.ps-message,.ps-error):not([hidden]) {position:absolute;z-index:3;top:6px;left:50%;transform:translateX(-50%);max-width:60%;background:var(--ps-paper)}
}
/* Keep full names readable at rest; action slots overlay only the row under inspection. */
body.studio-page .ps-knowledge-mode .ps-k-categories [data-ps-domain] {padding-right:10px!important}
body.studio-page .ps-knowledge-mode .ps-domain-chip:is(:hover,:focus-within) [data-ps-domain] {padding-right:66px!important}
body.private-view .ps-knowledge-mode > .ps-sidebar nav button {border:0;box-shadow:none;background:transparent}
body.private-view .ps-knowledge-mode > .ps-sidebar nav button[aria-current] {background:#edf4ff;color:var(--ps-accent,#286ff0)}
body.private-view .ps-knowledge-mode > .ps-sidebar nav button:hover {background:#f3f6fb}
/* Domain selection uses a soft fill, with no enclosing focus/selection frame. */
.ps-app.ps-knowledge-mode .ps-domain-chip,
.ps-app.ps-knowledge-mode .ps-domain-chip:focus-within {outline:none!important;box-shadow:none!important}
.ps-app.ps-knowledge-mode .ps-domain-chip[data-selected="true"],
.ps-app.ps-knowledge-mode .ps-domain-chip[data-selected="true"]:is(:hover,:focus-within) {background:var(--ps-chip-selected,#eef5ff)}
.ps-app.ps-knowledge-mode .ps-domain-chip[data-selected="true"]::before,
.ps-app.ps-knowledge-mode .ps-k-categories > [data-ps-clear-domain][aria-pressed="true"]::before {display:none}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-categories :is([data-ps-domain],[data-ps-clear-domain]):focus {outline:none!important;box-shadow:none!important}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-categories :is([data-ps-domain],[data-ps-clear-domain]):focus-visible {text-decoration:underline;text-underline-offset:4px}
/* Compact workspace gutters; retain readable padding inside each panel. */
@media(min-width:1181px) {
 body.private-view #private-study-root > .ps-app.ps-knowledge-mode > main.ps-content {padding:10px 10px 0!important}
 body.private-view .ps-knowledge-mode > .ps-sidebar {padding-top:10px}
 .ps-knowledge-mode .ps-knowledge-workspace,
 .ps-knowledge-mode .ps-knowledge-workspace > .ps-k-layout {gap:10px}
}
.ps-app.ps-knowledge-mode .ps-k-missing-filters,
.ps-app.ps-knowledge-mode .ps-k-selection-count,
.ps-app.ps-knowledge-mode .ps-k-select-file,
.ps-app.ps-knowledge-mode .ps-k-completion-tools {display:none!important}

/* Domain reorder handles stay visible at rest. */
.ps-knowledge-mode .ps-domain-chip::after {opacity:1}
/* Quiet text actions and an unboxed, left-aligned summary prompt. */
.ps-app.ps-knowledge-mode :is(.ps-k-row-actions,.ps-k-tools) button {
 border:0!important;box-shadow:none!important;background:transparent!important;
}
.ps-app.ps-knowledge-mode :is(.ps-k-row-actions,.ps-k-tools) button:hover {
 color:var(--ps-accent,#286ff0);text-decoration:underline;text-underline-offset:4px;
}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-k-summary-empty {
 background:transparent;border:0;border-radius:0;padding:0;justify-content:flex-start;
}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-k-summary-empty > span {display:none}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-k-summary-empty > button {
 border:0!important;box-shadow:none!important;background:transparent!important;padding-left:0;
}
/* A source PPT's first slide fills its detail preview card. */
.ps-app.ps-knowledge-mode .ps-k-detail .ps-media-slot:has(> .ps-ppt-cover-button) {padding:0;gap:0}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-media-slot > .ps-ppt-cover-button {
 position:absolute;inset:0;display:block;margin:0;width:100%;height:100%;padding:0;border:0;background:transparent;
}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-media-slot > .ps-ppt-cover-button .ps-ppt-cover {
 display:block;width:100%;height:100%;border:0;border-radius:0;
}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-media-slot > .ps-ppt-cover-button img {width:100%;height:100%;object-fit:cover}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-media-slot > .ps-ppt-cover-button ~ * {display:none!important}
.ps-app.ps-knowledge-mode .ps-k-detail .ps-media-slot > .ps-ppt-cover-button:focus-visible {outline-offset:-2px}
/* Compact article actions align with the title at the upper right. */
.ps-app.ps-knowledge-mode .ps-k-row-actions {align-self:flex-start;align-items:center;padding:10px 10px 0 0;gap:4px}
.ps-app.ps-knowledge-mode .ps-k-row-actions button {display:grid;place-items:center;width:30px;height:30px;min-height:30px;padding:5px;flex:none;line-height:1}
.ps-app.ps-knowledge-mode .ps-k-row-actions button svg {display:block;width:20px;height:20px}
.ps-app.ps-knowledge-mode .ps-k-row-actions button:hover {background:var(--ps-soft,#f1f4f8)!important;text-decoration:none}
@media(max-width:700px) {.ps-app.ps-knowledge-mode .ps-k-row-actions {margin-left:auto;padding:0 10px 10px 0}}
/* Prevent inherited button padding from compressing the action glyphs. */
.ps-app.ps-knowledge-mode .ps-k-row-actions button {
 box-sizing:border-box;width:32px!important;height:32px!important;min-width:32px;min-height:32px!important;
 padding:6px!important;color:var(--ps-action-icon,#526c8b)!important;
}
.ps-app.ps-knowledge-mode .ps-k-row-actions button svg {
 width:20px!important;height:20px!important;min-width:20px;min-height:20px;flex:none;stroke-width:1.4;
}
.ps-app.ps-knowledge-mode .ps-k-row-actions {gap:8px}
/* Batch completion was removed from the knowledge toolbar. */
.ps-app.ps-knowledge-mode [data-ps-enrich-batch] {display:none!important}

/* Remove the separate AI-classification shortcut, retaining the category selector. */
.ps-app.ps-knowledge-mode [data-ps-enrich-file][data-mode="category"] {display:none!important}
.ps-app.ps-knowledge-mode .ps-ppt-cover-message {display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:8px;color:var(--ps-muted);font-size:12px;line-height:1.5;text-align:center}
/* Leave room for the automatic-classification action beside Refresh. */
.ps-app.ps-knowledge-mode .ps-k-tools .ps-k-search {flex:1 1 180px;max-width:56%}
.ps-app.ps-knowledge-mode .ps-k-tools [data-ps-auto-classify] {white-space:nowrap;flex:none}
@media(max-width:850px) {.ps-app.ps-knowledge-mode .ps-k-tools .ps-k-search {max-width:none}}
/* Toolbar text actions (refresh / auto classify / summarize all) become icon buttons. */
.ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]) {
 display:grid;place-items:center;box-sizing:border-box;width:32px!important;height:32px!important;min-width:32px;min-height:32px!important;padding:6px!important;flex:none;line-height:1;color:var(--ps-action-icon,#526c8b)!important;
}
.ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]) svg {
 display:block;width:20px!important;height:20px!important;min-width:20px;min-height:20px;flex:none;stroke-width:1.4;
}
.ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]):hover:not(:disabled) {
 color:var(--ps-accent,#286ff0)!important;text-decoration:none;background:var(--ps-soft,#f1f4f8)!important;border-radius:6px;
}
.ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]):disabled {opacity:.4;cursor:default}
/* Batch enrichment progress banner is noise; hide it entirely. */
.ps-app.ps-knowledge-mode .ps-k-completion-status {display:none!important}
/* Side-collection headers carry an inline AI extraction action. */
.ps-app.ps-knowledge-mode .ps-k-side-collection h3 {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.ps-app.ps-knowledge-mode .ps-k-side-collection h3 .ps-k-collect-action {margin-left:auto}

/* Clip the label before the overlaid edit/delete buttons, including flex text/counts. */
body.studio-page .ps-app.ps-knowledge-mode .ps-domain-chip:is(:hover,:focus-within) [data-ps-domain] {
  clip-path: inset(0 66px 0 0);
  white-space: nowrap!important;
  overflow: hidden;
}
@media (hover:none) {
  body.studio-page .ps-app.ps-knowledge-mode .ps-domain-chip [data-ps-domain] {
    clip-path: inset(0 66px 0 0);
    white-space: nowrap!important;
    overflow: hidden;
  }
}

/* Knowledge toolbar: matching optical bounds, stroke and button surfaces. */
.ps-app.ps-knowledge-mode .ps-k-tools {gap:6px;align-items:center}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]) {
 display:grid;place-items:center;box-sizing:border-box;
 width:34px!important;height:34px!important;min-width:34px;min-height:34px!important;
 padding:7px!important;flex:0 0 34px;line-height:1;
 border:1px solid var(--ps-line,#e7edf4)!important;border-radius:6px!important;
 background:var(--ps-soft,#f5f7fa)!important;color:var(--ps-action-icon,#526c8b)!important;
}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]) svg {
 display:block;width:18px!important;height:18px!important;min-width:18px;min-height:18px;
 flex:none;stroke-width:1.7;
}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]):hover:not(:disabled) {
 color:var(--ps-accent,#286ff0)!important;background:var(--ps-chip-selected,#eef5ff)!important;
}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]):focus-visible {
 outline:2px solid var(--ps-accent,#286ff0);outline-offset:2px;
}
body.studio-page .ps-app.ps-knowledge-mode .ps-k-tools :is([data-ps-refresh-knowledge],[data-ps-auto-classify],[data-ps-summarize-all]):disabled {opacity:.5}

/* Reserve the grab cursor and drag initiation for the left gutter only. */
.ps-app.ps-knowledge-mode .ps-k-entry[data-ps-drag-file] {position:relative;cursor:default}
.ps-app.ps-knowledge-mode .ps-k-entry[data-ps-drag-file] .ps-k-icon {cursor:inherit}
.ps-app.ps-knowledge-mode .ps-k-entry[data-ps-drag-file] > .ps-k-file-drag-handle {
 position:absolute;z-index:2;left:0;top:8px;bottom:8px;width:12px;
 cursor:grab;user-select:none;touch-action:none;
}
.ps-app.ps-knowledge-mode .ps-k-entry[data-ps-drag-file] > .ps-k-file-drag-handle:active {cursor:grabbing}
