/* Project library: a quiet document rail and a focused reading surface. */
.pl-shell{padding:0;overflow:visible;font-weight:400}
.pl-shell summary{cursor:pointer}
.pl-topbar,.pl-topbar-actions,.pl-header,.pl-document-actions,.pl-actions,.pl-footer{display:flex;align-items:center;gap:10px}
.pl-topbar{position:relative;justify-content:space-between;flex-wrap:wrap;padding:14px 20px;border-bottom:1px solid var(--line)}
.pl-overview{margin:0;color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}
.pl-topbar-actions{margin-left:auto;flex-wrap:wrap;min-width:0}
.pl-upload-box{font-size:12px;min-width:0;position:static}
.pl-upload-box>summary{list-style:none;padding:6px 12px;border:1px solid var(--line);border-radius:var(--radius);color:var(--text)}
.pl-upload-box>summary::-webkit-details-marker{display:none}
.pl-upload-box[open]>summary{background:var(--control-selected)}
.pl-upload{position:absolute;right:14px;top:calc(100% + 8px);z-index:8;width:390px;max-width:calc(100vw - 56px);padding:16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--ui-shadow)}
.pl-file-label{display:grid;gap:7px;font-size:12px;min-width:0;width:100%;margin:0!important}
.pl-upload input[type=file]{max-width:100%;min-width:0;width:100%;font-size:12px}
.pl-upload>details{flex-basis:100%;color:var(--muted);font-size:12px}
.pl-upload small{display:block;margin-top:8px;line-height:1.7}
.pl-grid{display:grid;grid-template-columns:224px minmax(0,1fr);min-height:420px}
.pl-sidebar{min-width:0;padding:20px 12px;border-right:1px solid var(--line)}
.pl-doc-picker>summary{font-size:12px;font-weight:600;padding:0 8px 14px;color:var(--muted)}
.pl-doc-picker>summary>span{float:right;font-size:12px;font-weight:400;font-variant-numeric:tabular-nums}
.pl-shell .filter-group{display:flex;border:0;background:transparent;padding:0;gap:3px;margin:0 4px 12px;flex-wrap:wrap}
.pl-shell .filter-group button{border:0!important;padding:4px 8px!important;color:var(--muted)}
.pl-shell .filter-group button[aria-pressed=true]{background:var(--control-selected);color:var(--text)}
.pl-docs{max-height:65vh;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.pl-document{display:grid;gap:7px;position:relative;width:100%;text-align:left;padding:12px;margin:2px 0;border:0;border-radius:6px;background:transparent}
.pl-document:hover:not(:disabled){background:var(--control-hover)}
.pl-document.active,.pl-document.active:hover:not(:disabled){background:var(--control-selected)}
.pl-document.active:before{content:'';position:absolute;left:0;top:14px;bottom:14px;width:2px;background:var(--focus-ring);border-radius:2px}
.pl-document strong{font-size:12px;font-weight:500;line-height:1.6;overflow-wrap:anywhere}
.pl-document.active strong{font-weight:600}
.pl-document>span{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted);flex-wrap:wrap;line-height:1.5}
.pl-state-dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--muted);flex-shrink:0}
.pl-state-dot[data-state=approved],.pl-state[data-state=approved]{color:var(--state-success)}
.pl-state-dot[data-state=approved]{background:var(--state-success)}
.pl-state-dot[data-state=ready],.pl-state-dot[data-state=extracting]{background:var(--state-warning)}
.pl-state[data-state=ready],.pl-state[data-state=extracting]{color:var(--state-warning)}
.pl-state-dot[data-state=failed]{background:var(--state-danger)}
.pl-review{min-width:0;padding:26px 32px 32px}
.pl-review-header{justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:22px}
.pl-review-header>div:first-child{min-width:0}
.pl-header h3{margin:0;font-size:19px;line-height:1.5;font-weight:600;letter-spacing:-.2px;overflow-wrap:anywhere}
.pl-review-header small{display:block;margin-top:7px;color:var(--muted);font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.pl-document-actions{flex-shrink:0;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.pl-shell button:not(.pl-document):not(.primary){padding:6px 10px;border:1px solid var(--line);border-radius:var(--radius);font-size:12px;min-height:32px}
.pl-shell .pl-refresh,.pl-document-actions button{border-color:transparent!important;color:var(--muted)}
.pl-shell .pl-refresh:hover:not(:disabled),.pl-document-actions button:hover:not(:disabled){background:var(--control-hover);color:var(--text)}
.pl-shell input:not([type=checkbox]):not([type=file]),.pl-shell textarea,.pl-shell select{box-sizing:border-box;background:var(--surface-inset);color:var(--text);border:1px solid var(--control-border);border-radius:var(--control-radius);padding:6px 9px;font:inherit;font-size:12px;min-height:32px;max-width:100%}
.pl-shell input:focus-visible,.pl-shell textarea:focus-visible,.pl-shell select:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.pl-review-controls{position:sticky;top:0;background:var(--surface);z-index:4;border-block:1px solid var(--line);margin-top:16px}
.pl-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 0}
.pl-toolbar>input{flex:1 1 180px;min-width:120px;width:180px;max-width:320px!important}
.pl-toolbar>select{width:112px;min-width:0}
.pl-toolbar>small{margin-left:auto;font-size:12px;color:var(--muted);white-space:nowrap}
.pl-batch{font-size:12px;color:var(--muted)}
.pl-batch[open]{flex-basis:100%}
.pl-batch>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 0 2px}
.pl-batch select{width:112px}
.pl-batch small{font-size:12px}
.pl-points{padding:0;min-width:0}
.pl-point{padding:19px 0;border-bottom:1px solid var(--line)}
.pl-point:last-child{border-bottom:0}
.pl-point-head{display:grid;grid-template-columns:34px minmax(0,1fr) 100px 44px;gap:10px;align-items:start}
.pl-point-heading{font-size:14px;line-height:1.65;font-weight:600;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pl-point-expanded .pl-point-heading{display:block;-webkit-line-clamp:unset}
.pl-point-main{min-width:0;margin-left:44px}
.pl-point-text{font-size:14px;line-height:1.75;font-weight:400;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 9px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pl-point-full{display:block;overflow:visible;-webkit-line-clamp:unset}
.pl-point small{display:block;font-size:12px;line-height:1.65;color:var(--muted);overflow-wrap:anywhere;font-weight:400}
.pl-point-read .pl-point-head{grid-template-columns:24px minmax(0,1fr) auto 44px}
.pl-point-read .pl-point-main{margin-left:34px}
.pl-point-number,.pl-point-category{font-size:12px;line-height:2.1;color:var(--muted);font-variant-numeric:tabular-nums;font-weight:400}
.pl-point-category{max-width:120px;overflow-wrap:anywhere}
.pl-shell .pl-point-head button{padding:2px!important;border-color:transparent!important;background:transparent;color:var(--muted);min-height:28px!important}
.pl-shell .pl-point-head button:hover:not(:disabled){color:var(--text);background:var(--control-hover)}
.pl-point-head select{width:100px}
.pl-check{display:flex;gap:6px;align-items:center;margin:2px 0 0;font-size:12px;color:var(--muted)}
.pl-check input{width:16px;height:16px;min-height:0;flex-shrink:0;margin:0;accent-color:var(--action-bg)}
.pl-excluded .pl-point-heading,.pl-excluded .pl-point-text{color:var(--muted)}
.pl-uncertain{color:var(--state-warning)}
.pl-edit{display:grid;gap:10px;margin:10px 0}
.pl-edit label{display:grid;gap:5px;font-size:12px;color:var(--muted)}
.pl-edit input,.pl-edit textarea{width:100%;min-width:0}
.pl-edit textarea{resize:vertical;line-height:1.7;min-height:100px}
.pl-extraction,.pl-version{font-size:12px;margin:10px 0;color:var(--muted);line-height:1.65}
.pl-actions{flex-wrap:wrap;margin:8px 0}
.pl-actions small{font-size:12px;line-height:1.65}
.pl-review-options{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.pl-review-options label{display:grid;gap:5px;flex:1;font-size:12px;min-width:0}
.pl-review-options select{width:100%;min-width:0}
.pl-footer{flex-wrap:wrap;padding:2px 0 10px;gap:6px}
.pl-footer span{margin-right:auto;flex:1 1 110px;font-size:12px;color:var(--muted)}
.pl-footer>button{flex-shrink:0;white-space:nowrap}
.pl-footer .primary{font-size:12px;padding:7px 12px;min-height:32px}
.pl-message{font-size:12px;color:var(--muted);padding:12px 20px;margin:0;border-bottom:1px solid var(--line)}
.pl-message:empty{display:none}
.pl-shell>.form-error,.pl-shell>.pl-warning,.pl-shell>.pl-scope-note{margin:12px 20px}
.pl-warning{padding:10px 12px;border:1px solid var(--state-warning);border-radius:var(--radius);font-size:12px;line-height:1.7;overflow-wrap:anywhere;margin:10px 0}
.pl-warning details{margin:6px 0}
.pl-scope-note{margin:10px 0;font-size:12px;color:var(--muted);line-height:1.7;overflow-wrap:anywhere}
.pl-compare-point{margin:8px 0;padding:8px 0;border-top:1px solid var(--line);white-space:normal;overflow-wrap:anywhere}
.pl-compare-point p{margin:5px 0;white-space:pre-wrap}
.pl-placeholder{min-height:330px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:10px;color:var(--muted);padding:30px 16px}
.pl-placeholder-mark{display:grid;place-items:center;border:1px solid var(--line);border-radius:12px;width:44px;height:48px;font-size:24px;line-height:1;margin-bottom:6px}
.pl-placeholder h3{font-size:16px;font-weight:500;color:var(--text);margin:0}
.pl-placeholder p{font-size:12px;line-height:1.7;margin:0}
.pl-empty{font-size:12px;padding:16px 8px;color:var(--muted)}
@media(min-width:1440px){.pl-grid{grid-template-columns:248px minmax(0,1fr)}.pl-review{padding:30px 44px 40px}}
@media(max-width:1100px){.pl-grid{grid-template-columns:194px minmax(0,1fr)}.pl-review{padding:22px}.pl-toolbar>small{flex-basis:100%;margin-left:0}}
@media(max-width:900px){
 .pl-topbar{padding:12px 14px;gap:8px}.pl-topbar-actions{gap:4px}
 .pl-grid{grid-template-columns:minmax(0,1fr);min-height:0}
 .pl-sidebar{border-right:0;border-bottom:1px solid var(--line);padding:12px 14px}
 .pl-doc-picker>summary{padding:0;color:var(--text)}
 .pl-doc-navigation{padding-top:12px}
 .pl-shell .filter-group{margin-left:0}
 .pl-docs{max-height:180px}
 .pl-document{padding:10px 12px}
 .pl-review{padding:20px 16px}
 .pl-review-header{gap:10px;margin-bottom:16px;flex-wrap:wrap}
 .pl-header h3{font-size:17px}
 .pl-document-actions{justify-content:flex-start}
 .pl-toolbar>input{max-width:none!important;flex:1 1 100%}
 .pl-toolbar>select{flex:1 1 100px}
 .pl-toolbar>small{flex-basis:auto;margin-left:auto}
 .pl-review-controls{margin-top:12px}
 .pl-shell input:not([type=checkbox]):not([type=file]),.pl-shell textarea,.pl-shell select{font-size:16px}
 .pl-point{padding:16px 0}
 .pl-point-head{grid-template-columns:30px minmax(0,1fr) 80px 36px;gap:6px}
 .pl-point-head select{width:80px}
 .pl-point-main{margin-left:36px}
 .pl-point-read .pl-point-head{grid-template-columns:18px minmax(0,1fr) auto 36px}
 .pl-point-read .pl-point-main{margin-left:24px}
 .pl-point-category{max-width:60px}
 .pl-point-heading,.pl-point-text{font-size:13px}
 .pl-check input{width:18px;height:18px}
 .pl-footer span{flex:1 0 100%}
 .pl-footer>button{flex:1 1 calc(50% - 8px)}
 .pl-review-options label{flex-basis:100%}
 .pl-placeholder{min-height:240px}
}

/* On short or heavily zoomed viewports, let the controls scroll with the text. */
@media(max-height:560px){.pl-review-controls{position:static}}

/* Source follows the title; the text uses a compact two-line reading area. */
.pl-point{padding:10px 0}
.pl-point-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 12px;min-width:0}
.pl-point-title>.pl-point-heading{font-size:13px;line-height:1.6;min-width:0;max-width:100%}
.pl-point-title>.pl-point-source{display:block;margin:0;font-size:12px;line-height:1.6;min-width:0;max-width:100%}
.pl-point-text{font-size:13px;line-height:1.6;margin:3px 0 0}
@media(max-width:900px){.pl-point{padding:9px 0}.pl-point-title{gap:2px 8px}}

/* Keep project navigation, document details and review actions in view. */
body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]){height:100dvh;display:flex;flex-direction:column;overflow:hidden}
body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar{flex-shrink:0}
body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) .workspace{flex:1;min-height:0;display:flex;flex-direction:column}
body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) .topbar{flex-shrink:0;width:100%}
body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) main{flex:1;min-height:0;width:100%;display:flex;flex-direction:column;padding-bottom:12px}
body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) .page-heading{flex-shrink:0}
#project-view:not([hidden]):has(#project-detail[data-tab="library"]),#project-detail[data-tab="library"],#project-library-host,.pl-shell{flex:1;min-height:0;display:flex;flex-direction:column}
#project-detail[data-tab="library"]>.project-navigation,#project-detail[data-tab="library"]>.project-context,.pl-topbar,.pl-message,.pl-shell>.form-error,.pl-shell>.pl-warning{flex-shrink:0}
#project-library-host .pl-shell{margin:0;overflow:hidden}
.pl-grid{flex:1;min-height:0;overflow:hidden}
.pl-sidebar{overflow:auto;min-height:0}
.pl-docs{max-height:none}
.pl-review{min-height:0;overflow:hidden;display:flex;flex-direction:column}
.pl-review-info{flex-shrink:0;max-height:38%;overflow:auto;overscroll-behavior:contain}
.pl-review-header{margin-bottom:12px}
.pl-review-controls{position:static;flex-shrink:0;max-height:42%;overflow:auto;margin-top:8px}
.pl-points{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.pl-points:focus-visible{outline:1px solid var(--focus-ring);outline-offset:-1px}
.pl-upload-direct{position:relative;display:inline-flex;align-items:center;cursor:pointer;font-size:12px;min-height:32px;margin:0!important;overflow:hidden}
.pl-upload-direct input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.pl-upload-direct:focus-within{outline:2px solid var(--focus-ring);outline-offset:2px}
.pl-upload-direct[aria-disabled=true]{opacity:.5;cursor:default}
.pl-progress-active{display:flex;align-items:center;gap:8px;color:var(--state-info)}
.pl-progress-active:before{content:'';flex-shrink:0;width:10px;height:10px;border:2px solid var(--line);border-top-color:var(--state-info);border-radius:50%;animation:pl-spin 1s linear infinite}
@keyframes pl-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.pl-progress-active:before{animation:none}}
.pl-catalog-nav{display:grid;gap:8px;margin:0 4px 12px;min-width:0}
.pl-catalog-nav>input,.pl-catalog-nav>select{width:100%;min-width:0}
.pl-folder-edit,.pl-catalog-edit{font-size:12px;color:var(--muted);margin:8px 0}
.pl-folder-edit label,.pl-catalog-edit label{display:grid;gap:5px;margin:8px 0;font-size:12px;min-width:0}
.pl-folder-edit input,.pl-catalog-edit input,.pl-catalog-edit select{width:100%;min-width:0}
.pl-folder-edit>div,.pl-catalog-edit>div{display:flex;flex-wrap:wrap;gap:6px;align-items:end}
.pl-catalog-edit label{flex:1 1 180px}
.pl-folder-edit>label{width:100%}
@media(max-width:900px){
 .pl-grid{display:flex;flex-direction:column}
 .pl-sidebar{flex-shrink:0;max-height:32%;padding-block:8px}
 .pl-review{flex:1;padding:12px 14px}
 .pl-review-header{margin-bottom:8px}
 .pl-header h3{font-size:15px}
 .pl-topbar{padding-block:9px}
 .pl-message{padding-block:8px}
 .pl-review-info{max-height:35%}
 .pl-review-controls{max-height:48%}
 .pl-catalog-nav{margin-inline:0}
 .pl-catalog-edit label{flex-basis:100%}
 .pl-placeholder{min-height:0}
}
@media(max-height:560px){.pl-review{padding:8px 12px}.pl-review-info{max-height:30%}.pl-topbar{padding-block:6px}.pl-message{padding-block:6px}.pl-toolbar{padding-block:6px}}
@media(max-width:900px){
 .pl-toolbar{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;gap:6px}
 .pl-toolbar>input{flex:0 0 150px;max-width:150px!important}
 .pl-toolbar>select{flex:0 0 108px}
 .pl-toolbar>small,.pl-batch{flex:0 0 auto;white-space:nowrap}
 .pl-batch[open]{flex-basis:220px;white-space:normal}
 .pl-review-info{max-height:28%}
 .pl-review-controls{max-height:45%}
 .pl-footer{gap:4px}
 .pl-footer>button{flex:1 1 calc(50% - 4px);min-height:32px}
 .pl-message{max-height:48px;overflow:auto;font-size:12px;padding-block:6px}
}
@media(max-width:700px){
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar{display:grid;grid-template-columns:28px minmax(0,1fr) auto auto;gap:4px 8px;align-items:center;padding:6px 12px;min-height:0}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar .brand{grid-column:1;grid-row:1;gap:0;margin:0;min-width:0}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar .brand>span:last-child{display:none}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar>nav{grid-column:2/5;grid-row:1;display:flex;flex-wrap:nowrap;gap:2px;min-width:0;overflow-x:auto;margin:0;padding:0}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar>nav .nav-item{flex-shrink:0;min-height:44px;padding:7px 8px;white-space:nowrap}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) #account-open{grid-column:1/3;grid-row:2;justify-self:start;min-width:0;min-height:32px;padding:4px 0;font-size:12px;white-space:nowrap}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) #feedback-open{grid-column:3;grid-row:2;min-height:32px;padding:4px 8px;font-size:12px;white-space:nowrap}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) #account-logout{grid-column:4;grid-row:2;min-height:32px;display:flex;align-items:center;margin:0;font-size:12px;white-space:nowrap}
}
@media(max-width:900px){
 .pl-footer{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 :root:lang(en) .pl-footer{grid-template-columns:repeat(auto-fit,minmax(min(100%,130px),1fr))}
 .pl-footer>span{grid-column:1/-1;margin:0}
 .pl-footer>button{min-width:0;min-height:44px!important;padding:5px 4px!important;font-size:12px!important}
 :root:lang(en) .pl-footer>button{white-space:normal;line-height:1.3;padding:6px 8px!important}
}
.pl-toolbar input,.pl-toolbar select{margin:0!important}
@media(max-width:900px){
 .pl-toolbar{padding:4px 0}
 .pl-footer{padding-bottom:6px}
 .pl-footer>span{line-height:1.3}
 .pl-review-controls{max-height:55%}
 .pl-review-info{max-height:24%}
}
@media(max-width:700px){
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) #page-title{font-size:18px;line-height:1.35}
}
@media(max-height:560px){
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar{display:flex;flex-wrap:nowrap;gap:12px;padding:4px 12px;min-height:54px;overflow-x:auto}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar>*{flex-shrink:0}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) #page-title{font-size:18px;line-height:1.35}
 .pl-message{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:28px}
 .pl-review-info{max-height:20%}
 .pl-review-controls{max-height:65%}
}
@media(max-height:560px) and (min-width:701px){
 .pl-footer{display:flex;flex-wrap:nowrap}
 .pl-footer>span{flex:1;margin-right:auto}
 .pl-footer>button{flex:0 0 auto}
}

/* Phone review keeps selection and actions in one row. */
@media(max-width:700px){
 .pl-topbar{padding:6px 10px}
 .pl-sidebar{padding:6px 10px}
 .pl-review{padding:8px 10px}
 .pl-review-header{margin-bottom:4px}
 .pl-catalog-nav{display:flex;flex-wrap:wrap;gap:4px}
 .pl-catalog-nav>input,.pl-catalog-nav>select{flex:1 1 100px;width:0;min-width:100px;min-height:44px}
 .pl-catalog-nav>.pl-folder-edit{flex:1 1 100%;margin:2px 0}
 .pl-footer{grid-template-columns:54px repeat(4,minmax(0,1fr));align-items:center;padding-bottom:4px}
 .pl-footer>span{grid-column:auto;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
 .pl-footer>button{font-size:12px!important;padding-inline:2px!important}
}
/* A landscape phone gives the points the full available reading height. */
@media(min-width:701px) and (width < 1001px) and (max-height:560px){
 .pl-review{display:grid;grid-template-columns:270px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;gap:4px 12px;padding:6px 10px}
 .pl-review-info{grid-column:1;grid-row:1;max-height:none;min-height:0;overflow:auto}
 .pl-review-controls{display:contents}
 .pl-toolbar{grid-column:1;grid-row:2;min-width:0;padding:2px 0;border-top:1px solid var(--line)}
 .pl-footer{grid-column:1;grid-row:3;display:grid;grid-template-columns:50px repeat(4,minmax(0,1fr));align-items:center;gap:3px;padding:0}
 .pl-footer>span{grid-column:auto;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
 .pl-footer>button{font-size:12px!important;padding-inline:2px!important}
}

/* Phone reading uses the width released by shorter labels and margins. */
@media(max-width:700px){
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"])>.sidebar,
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="query"])>.sidebar{padding-block:0;row-gap:0}
 .pl-topbar{padding:3px 8px;gap:4px}
 .pl-sidebar{padding:4px 8px}
 .pl-review{padding:6px 8px}
 .pl-review-header{margin-bottom:2px;gap:6px}
 .pl-header h3{font-size:14px}
 .pl-review-header small{margin-top:3px}
 .pl-point{padding:6px 0}
 .pl-point-head{gap:4px}
 .pl-point-main{margin-left:32px}
 .pl-point-read .pl-point-main{margin-left:22px}
 .pl-toolbar{padding:2px 0}
 .pl-footer{padding-bottom:2px}
}

/* Component controls share the global action hierarchy and focus treatment. */
.pl-sidebar{background:var(--surface-soft)}
.pl-shell button:not(.pl-document):not(.primary){border-radius:var(--control-radius)}
.pl-shell button:not(.pl-document):not(.primary):hover:not(:disabled){background:var(--control-hover);border-color:var(--control-border)}
.pl-shell .filter-group button[aria-pressed=true]:hover:not(:disabled){background:var(--control-selected)}
.pl-shell button:focus-visible,.pl-shell summary:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.pl-upload-direct:hover:not([aria-disabled=true]){background:var(--control-hover);border-color:var(--control-border)}

/* Visible folders and direct document moves share the existing reading rail. */
.pl-grid{grid-template-columns:286px minmax(0,1fr)}
.pl-sidebar{display:flex;flex-direction:column;overflow:hidden;padding:14px 10px}
.pl-doc-picker[open]{display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden}
.pl-doc-picker::details-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.pl-doc-picker>summary{flex-shrink:0;padding-bottom:10px}
.pl-doc-navigation{display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
.pl-folder-section{flex:0 1 auto;min-height:0;max-height:60%;overflow:auto;padding:0 3px 10px;border-bottom:1px solid var(--line);scrollbar-width:thin}
.pl-folder-heading,.pl-list-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.pl-folder-heading{margin-bottom:5px}
.pl-folder-heading>strong,.pl-list-heading>strong{font-size:12px;font-weight:600;min-width:0;overflow-wrap:anywhere}
.pl-folder-heading{flex-wrap:wrap}
.pl-folder-actions{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;margin-left:auto}
.pl-folders{display:grid;align-content:start;gap:2px;padding:2px}
.pl-shell .pl-folder{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;width:100%;text-align:left;border-color:transparent!important;background:transparent;padding:7px 8px!important}
.pl-folder-label{min-width:0;overflow-wrap:anywhere}
.pl-folder-count{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;flex-shrink:0}
.pl-shell .pl-folder.active,.pl-shell .pl-folder.active:hover:not(:disabled){background:var(--control-selected);color:var(--text)}
.pl-shell .pl-folder.pl-drop-active{outline:2px solid var(--focus-ring);outline-offset:-2px;background:var(--control-selected)!important}
.pl-folder-editor,.pl-move-editor{display:grid;gap:6px;padding:9px;margin-top:7px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);min-width:0}
.pl-folder-editor>label,.pl-move-editor>label{font-size:12px;line-height:1.4;color:var(--muted);margin:0!important}
.pl-folder-editor>input,.pl-move-editor>select{width:100%;min-width:0;margin:0!important}
.pl-folder-editor>div,.pl-move-editor>div{display:flex;flex-wrap:wrap;gap:6px}
.pl-move-editor{margin:0}
.pl-move-editor>p{font-size:12px;line-height:1.5;margin:0;overflow-wrap:anywhere}
.pl-move-editor strong{font-weight:500}
.pl-catalog-nav{display:grid;flex:0 1 auto;min-height:0;max-height:45%;overflow:auto;gap:6px;margin:10px 3px 6px;padding:2px;scrollbar-width:thin}
.pl-list-heading>small{flex-shrink:0;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.pl-catalog-nav>.filter-group{margin:0;gap:3px}
.pl-drag-help{font-size:12px;line-height:1.5;color:var(--muted);margin:0}
.pl-docs{flex:1;min-height:86px;max-height:none;padding:2px}
.pl-document-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;align-items:center;gap:1px;border-bottom:1px solid var(--line);min-width:0}
.pl-document-row[draggable=true]{cursor:grab}
.pl-document-row.pl-dragging{opacity:.5}
.pl-document-row>.pl-document{min-width:0;gap:2px;padding:8px}
.pl-document-row>.pl-document:only-child{grid-column:1/-1}
.pl-document-row:has(>.pl-pending-link){grid-template-columns:minmax(0,1fr)}
.pl-document-row>.pl-pending-link{justify-self:start;margin:0 8px 6px;padding:3px 6px;color:var(--state-info);font:inherit;font-size:12px}
.query-source-popup.shows-original{width:min(830px,calc(100vw - 32px));max-height:88dvh}
.query-source-popup.shows-original>.query-source-title,.query-source-popup.shows-original>.query-source-excerpt{display:none}
.query-source-popup .query-cited-original{clear:both;margin-top:8px}
.query-source-popup .query-cited-original .pl-original{max-height:64dvh}
.query-source-popup .query-cited-original[hidden],.query-source-popup .query-open-original[hidden]{display:none}
.pl-document-location{font-size:12px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.pl-shell .pl-move-button{font-size:12px;padding:5px 3px!important;border-color:transparent!important;color:var(--muted);min-width:0}
@media(min-width:1440px){.pl-grid{grid-template-columns:300px minmax(0,1fr)}}
@media(min-width:901px) and (max-width:1100px){.pl-grid{grid-template-columns:258px minmax(0,1fr)}}
@media(max-width:900px){
 .pl-sidebar{max-height:62%;padding:6px 10px}
 .pl-grid:has(.pl-placeholder) .pl-sidebar{flex:1;max-height:none}
 .pl-grid:has(.pl-placeholder) .pl-review{display:none}
 .pl-doc-navigation{padding-top:5px}
 .pl-folder-section{padding-bottom:5px;max-height:58%}
 .pl-folder-heading{margin-bottom:2px}
 .pl-folder-heading>strong{font-size:12px}
 .pl-folder-actions>button,.pl-folder-editor button,.pl-move-editor button,.pl-move-editor select{min-height:44px!important}
 .pl-folders{grid-template-columns:repeat(auto-fit,minmax(min(100%,110px),1fr));gap:4px}
 .pl-shell .pl-folder{min-height:44px;padding:5px 8px!important}
 .pl-folder-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
 .pl-catalog-nav{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;margin:5px 2px;max-height:46%}
 .pl-catalog-nav>input{width:100%;min-width:0;min-height:44px}
 .pl-catalog-nav>.filter-group{flex-wrap:nowrap}
 .pl-catalog-nav>.filter-group>button{min-height:44px}
 .pl-drag-help{display:none}
 .pl-docs{min-height:72px}
 .pl-document-row{grid-template-columns:minmax(0,1fr) 48px}
 .pl-shell .pl-move-button{min-height:44px!important}
 .pl-document-row>.pl-document{min-height:66px;padding:7px}
 .pl-document-location{font-size:12px}
}

/* Older engines without the details content pseudo-element still get a
   bounded rail: absolute content bypasses their anonymous details wrapper. */
@supports not selector(details::details-content){
 .pl-doc-picker[open]{display:block;position:relative}
 .pl-doc-picker>summary{height:30px;box-sizing:border-box}
 .pl-doc-picker[open]>.pl-doc-navigation{position:absolute;inset:30px 0 0}
 @media(max-width:900px){
  .pl-sidebar:has(.pl-doc-picker[open]){height:62%;flex:0 0 62%}
  .pl-grid:has(.pl-placeholder) .pl-sidebar{height:auto;flex:1;max-height:none}
 }
}

/* On compact viewports, give the active organizing form the available area.
   The document, filters and reading state stay mounted and return on exit. */
@media(max-width:900px),(max-height:600px){
 .pl-shell:has(.pl-folder-editor) .pl-grid,
 .pl-shell:has(.pl-move-editor) .pl-grid{display:flex;flex-direction:column}
 .pl-shell:has(.pl-folder-editor) .pl-sidebar,
 .pl-shell:has(.pl-move-editor) .pl-sidebar{flex:1;max-height:none;height:auto;min-height:0}
 .pl-shell:has(.pl-folder-editor) .pl-review,
 .pl-shell:has(.pl-move-editor) .pl-review,
 .pl-shell:has(.pl-folder-editor) .pl-docs,
 .pl-shell:has(.pl-move-editor) .pl-docs{display:none}
 .pl-shell:has(.pl-folder-editor) .pl-catalog-nav,
 .pl-shell:has(.pl-move-editor) .pl-folder-section{display:none}
 .pl-shell:has(.pl-folder-editor) .pl-folder-section{flex:1;max-height:none;overflow:auto;border:0;padding:2px}
 .pl-shell:has(.pl-folder-editor) .pl-folder-section>*:not(.pl-folder-editor){display:none}
 .pl-shell:has(.pl-move-editor) .pl-catalog-nav{flex:1;max-height:none;overflow:auto;margin:0;padding:2px;display:block}
 .pl-shell:has(.pl-move-editor) .pl-catalog-nav>*:not(.pl-move-editor){display:none}
 .pl-folder-editor,.pl-move-editor{margin:0;width:100%;box-sizing:border-box;gap:6px}
 .pl-folder-editor>input,.pl-move-editor>select{min-height:44px}
 .pl-folder-editor>div,.pl-move-editor>div{flex-shrink:0;position:sticky;bottom:0;z-index:1;background:var(--surface);padding-top:4px}
 .pl-folder-editor button,.pl-move-editor button{min-height:44px!important}
 .pl-shell>.pl-warning button{min-height:44px!important}
 .pl-move-editor>p{max-height:3em;overflow:auto}
}

/* Review stays in context, with one primary commit and exact source excerpts. */
.pl-upload-hint{font-size:12px;color:var(--muted)}
.pl-source-button{display:inline!important;padding:2px 5px!important;min-height:0;border:0!important;color:var(--state-info)!important;font-size:12px!important;background:transparent}
.pl-source-excerpt{margin:10px 0 4px;padding:12px;border-left:2px solid var(--control-border);border-radius:0 var(--radius) var(--radius) 0;background:var(--surface-soft);font-size:12px;line-height:1.7;overflow-wrap:anywhere;white-space:normal}
.pl-source-excerpt p{white-space:pre-wrap;margin:5px 0;max-height:240px;overflow:auto}
.pl-source-excerpt small{color:var(--muted)}
.pl-next-choice{display:flex;align-items:center;gap:6px;margin:0!important;font-size:12px!important;color:var(--muted);white-space:normal}
.pl-next-choice input{margin:0;width:16px;height:16px;flex-shrink:0}
.pl-secondary-actions{font-size:12px;flex-shrink:0}
.pl-secondary-actions>summary{padding:9px 4px;list-style:none;color:var(--muted)}
.pl-secondary-actions>summary::-webkit-details-marker{display:none}
.pl-secondary-actions[open]{display:flex;flex-wrap:wrap;gap:4px}
.pl-footer{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.pl-footer>span{flex:1 1 auto;grid-column:auto}
.pl-footer>.primary{flex:0 0 auto;min-height:40px}
.pl-catalog-edit[open]>summary{font-size:12px}
.pl-catalog-edit label{margin:4px 0}
.pl-catalog-edit>div>small{font-size:12px}
@media(max-width:900px){
 .pl-footer{display:flex;flex-wrap:wrap;gap:4px 8px}
 .pl-footer>span{flex:1 1 40%;font-size:12px}
 .pl-footer>.pl-next-choice{flex:0 1 auto;min-height:32px}
 .pl-footer>.pl-secondary-actions{flex:1 1 auto}
 .pl-secondary-actions>summary{min-height:44px;display:flex;align-items:center;padding:4px}
 .pl-footer>.primary{flex:0 1 auto;font-size:12px!important;padding:8px 12px!important;min-height:44px!important}
 .pl-review-info{max-height:32%}
 .pl-review-controls{max-height:52%}
 .pl-source-button{min-height:32px;font-size:12px!important}
 .pl-catalog-edit label{flex-basis:150px}
 .pl-upload-hint{display:none}
 .pl-upload-direct{min-height:44px}
}
@media(max-height:560px) and (min-width:701px) and (width < 1001px){.pl-review-info{max-height:none}.pl-footer{grid-column:1;grid-row:3}.pl-footer>span{flex-basis:45%}.pl-next-choice{font-size:12px!important}.pl-review-controls{max-height:none}}
@media(max-width:600px){.pl-footer>.pl-secondary-actions{flex:1 1 45%}.pl-footer>.pl-next-choice{min-height:44px}.pl-source-button{min-height:44px}.pl-next-choice{cursor:pointer}}
@media(min-width:560px) and (max-width:700px) and (max-height:560px){
 .pl-review{display:grid;grid-template-columns:250px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;gap:4px 10px;padding:6px 8px}
 .pl-review-info{grid-column:1;grid-row:1;max-height:none;min-height:0;overflow:auto}
 .pl-review-controls{display:contents}
 .pl-toolbar{grid-column:1;grid-row:2;min-width:0}
 .pl-footer{grid-column:1;grid-row:3;min-width:0;padding:0;gap:4px}
 .pl-footer>span{flex-basis:45%}
 .pl-footer>.pl-secondary-actions{flex:1 1 40%}
}

/* Unified reading: one scroll area per column, never clipped metadata subpanels. */
#project-library-host .pl-shell{height:auto;max-height:none;overflow:visible}
#project-library-host .pl-grid{display:grid;grid-template-columns:clamp(228px,19%,340px) minmax(0,1fr);height:auto;min-height:0;overflow:hidden}
#project-library-host .pl-sidebar{display:flex;flex-direction:column;min-height:0;overflow:auto;padding:12px;border-right:1px solid var(--line)}
#project-library-host .pl-doc-picker{display:block;min-height:0;height:auto;max-height:none;overflow:visible}
#project-library-host .pl-docs{height:auto;min-height:72px}

#project-library-host .pl-review{display:flex;flex-direction:column;gap:12px;padding:16px;min-height:0;height:100%;overflow:auto;overscroll-behavior:contain}
#project-library-host .pl-review-info{order:0;flex:none;max-height:none;overflow:visible;min-height:0}
#project-library-host .pl-review-controls{display:contents;max-height:none;overflow:visible}
#project-library-host .pl-review-header{margin:0 0 8px;gap:12px}
#project-library-host .pl-header h3{font-size:17px}
#project-library-host .pl-review-header small{font-size:12px;margin-top:4px}
#project-library-host .pl-toolbar{order:1;display:flex;flex-wrap:wrap;gap:8px;padding:0;min-width:0;overflow:visible}
#project-library-host .pl-toolbar input{flex:1 1 180px;min-width:0;width:auto}
#project-library-host .pl-toolbar select{flex:0 1 140px;min-width:0;width:auto;margin:0}
#project-library-host .pl-points{order:2;flex:none;height:auto;max-height:none;min-height:0;overflow:visible;padding:0}
#project-library-host .pl-point{padding:12px 0;min-width:0}
#project-library-host .pl-point-title{font-size:14px;line-height:1.5}
#project-library-host .pl-point-title>.pl-point-heading{font-size:15px;font-weight:700;line-height:1.5}
#project-library-host .pl-point-text{font-size:14px;line-height:1.75;color:var(--text-soft)}
#project-library-host .pl-footer{order:3;position:sticky;bottom:-16px;z-index:4;flex:none;display:flex;flex-wrap:wrap;gap:8px;padding:12px 0;margin:0;border-top:1px solid var(--line);background:var(--surface);max-height:none;overflow:visible}
#project-library-host .pl-footer>.primary{margin-left:auto}
#project-library-host .pl-footer>span{flex:1 1 140px}
#project-library-host .pl-catalog-edit>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding-top:8px}
#project-library-host .pl-catalog-edit label{margin:0}
#project-library-host .pl-catalog-edit :is(small,button){grid-column:1/-1}
#project-library-host .pl-shell :is(input:not([type=checkbox]):not([type=file]),select){min-height:36px;font-size:13px}
#project-library-host .pl-shell button{font-size:13px}
#project-library-host .pl-folder-editor,#project-library-host .pl-move-editor{flex-shrink:0}
@media(width < 1001px){
 #project-library-host .pl-grid{display:block;height:auto;min-height:0;overflow:visible}
 #project-library-host .pl-sidebar{display:block;border-right:0;border-bottom:1px solid var(--line);padding:8px 12px;overflow:visible}
 #project-library-host .pl-review{height:auto;min-height:0;overflow:visible;padding:12px;gap:12px}
 #pl-reading-title{scroll-margin-block-start:calc(var(--shell-height) + 12px)}
 #pl-source-title{scroll-margin-block-start:calc(var(--shell-height) + 18px)}
 #project-library-host .pl-docs{max-height:50vh;overflow:auto}

 #project-library-host .pl-folder-editor,#project-library-host .pl-move-editor{max-height:none;overflow:visible}
 #project-library-host .pl-doc-picker>summary{padding:4px 0;min-height:36px}
 #project-library-host .pl-footer{bottom:0;padding:8px 0}
}
@media(max-width:700px){
 #project-library-host .pl-topbar{padding:8px 12px;gap:8px}
 #project-library-host .pl-topbar-actions{gap:4px}
 #project-library-host .pl-shell :is(input:not([type=checkbox]):not([type=file]),select){min-height:44px;font-size:16px}
 #project-library-host .pl-shell button,#project-library-host .pl-upload-direct{min-height:44px}
 #project-library-host .pl-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #project-library-host .pl-toolbar input{grid-column:1/-1;width:100%}
 #project-library-host .pl-toolbar select{width:100%;max-width:100%}
 #project-library-host .pl-catalog-edit>div{grid-template-columns:minmax(0,1fr)}
 #project-library-host .pl-footer>.primary{flex:1 1 100%;min-height:44px}
 #project-library-host .pl-footer>.pl-secondary-actions{margin-left:auto}
 #project-library-host .pl-source-button{min-height:32px;padding:4px!important}
}

/* Keep the mobile review controls compact without the legacy 150px search cap. */
#project-library-host .pl-toolbar input{max-width:none!important}
@media(max-width:700px){
 #project-library-host .pl-toolbar select{height:44px}
 #project-library-host .pl-footer>span{flex:1 1 64px;font-size:12px}
 #project-library-host .pl-footer>.pl-next-choice{flex:0 0 auto;white-space:nowrap;min-height:44px}
 #project-library-host .pl-footer>.pl-secondary-actions{flex:0 0 auto;margin-left:0}
 #project-library-host .pl-footer>.primary{width:100%;flex:1 1 100%}
}
/* Narrow screens use the page scroll, so no ancestor may clip the reading column. */
@media(width < 1001px){
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]){height:auto;min-height:100dvh;display:block;overflow:visible}
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) .workspace,
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]) main{display:block;height:auto;min-height:0;flex:none;overflow:visible}
 #project-view:not([hidden]):has(#project-detail[data-tab="library"]),#project-detail[data-tab="library"],#project-library-host,#project-library-host .pl-shell{display:block;flex:none;height:auto;overflow:visible}
 #project-library-host .pl-sidebar{max-height:none}
}

/* The open catalogue keeps folders and the document list independently scrollable. */
#project-library-host .pl-doc-picker{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
#project-library-host .pl-doc-picker>.pl-doc-navigation{position:static;inset:auto;flex:1;min-height:0}
@media(max-width:900px){#project-library-host .pl-sidebar{height:62%;flex:0 0 62%}}

.pl-topbar{border-radius:var(--radius) var(--radius) 0 0}
#project-library-host .pl-header h3{font:500 22px/1.4 var(--display-font);letter-spacing:.025em}
#project-library-host .pl-review-header{padding-bottom:10px;border-bottom:1px solid var(--line)}
.pl-shell .pl-folder.active,.pl-shell .pl-document.active{color:var(--ink)}
@media(max-width:700px){#project-library-host .pl-header h3{font-size:19px}}

.pl-verified{color:var(--state-success)}
.pl-verify{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px}
.pl-verify small{color:var(--muted)}

/* Keep the two collection lists independently scrollable beneath their controls. */
#project-library-host .pl-folder-section{display:flex;flex-direction:column;flex:0 1 auto;max-height:42%;overflow:auto}
#project-library-host .pl-folder-heading{flex:none}
#project-library-host :is(#pl-folder-list,#pl-document-list){min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;scrollbar-color:var(--control-border) var(--surface-inset)}
#pl-folder-list{min-height:0;max-height:clamp(85px,24vh,228px)}
#pl-document-list{display:flex;flex-direction:column;flex:1 1 0}
#pl-document-list>.pl-document-row{flex:none}
#project-library-host :is(#pl-folder-list,#pl-document-list)::-webkit-scrollbar{width:8px}
#project-library-host :is(#pl-folder-list,#pl-document-list)::-webkit-scrollbar-track{background:var(--surface-inset);border-radius:8px}
#project-library-host :is(#pl-folder-list,#pl-document-list)::-webkit-scrollbar-thumb{background:var(--control-border);border:1px solid var(--surface-inset);border-radius:8px}
#project-library-host :is(#pl-folder-list,#pl-document-list):focus-visible{outline:2px solid var(--focus-ring);outline-offset:-2px}
#project-library-host .pl-shell button.danger{color:var(--state-danger)}
@media(min-width:1001px) and (max-height:480px){
 body:has(#project-view:not([hidden])):has(#project-detail[data-tab="library"]){min-height:480px;overflow-y:auto}
}
@media(min-width:1001px){
 #project-library-host .pl-sidebar{overflow:hidden}
 #project-library-host .pl-catalog-nav{flex:none;max-height:46%}
}
@media(width < 1001px){
 #project-library-host .pl-sidebar{height:auto;max-height:none}
 #project-library-host .pl-folder-section{max-height:none}
 #project-library-host #pl-folder-list{max-height:clamp(90px,24dvh,205px)}
 #project-library-host #pl-document-list{flex:0 1 auto;max-height:clamp(120px,40dvh,325px)}
}

/* Published knowledge uses the same reading layout for files and Project-MD. */
#project-library-host .pl-knowledge-card{
  display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:11px;
  margin:0 0 12px;padding:16px 20px 11px;overflow-wrap:anywhere;
  border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-inset);
}
.pl-knowledge-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;min-width:0}
.pl-knowledge-number{
  flex:none;align-self:flex-start;padding:2px 8px;border:1px solid var(--control-border);
  border-radius:5px;background:var(--control-selected);color:var(--ink);
  font-size:12px;font-weight:650;font-variant-numeric:tabular-nums;line-height:1.6;
}
#project-library-host .pl-knowledge-head h4{flex:1 1 12ch;min-width:0;margin:0;font-size:17px;font-weight:650;line-height:1.5;color:var(--ink)}
.pl-knowledge-labels{display:flex;gap:5px;align-items:center;flex-wrap:wrap;font-size:12px}
.pl-knowledge-labels .pl-point-category{
  max-width:none;padding:1px 8px;border-radius:4px;background:var(--surface-soft);color:var(--text-soft);font-size:12px;line-height:1.7;
}
.pl-knowledge-content{
  display:-webkit-box;margin:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;
  color:var(--ink);font-size:14px;line-height:1.75;white-space:pre-line;
}
.pl-knowledge-content.is-expanded{display:block}
.pl-knowledge-meta{display:grid;min-width:0;gap:5px;padding-top:9px;border-top:1px solid var(--line);color:var(--muted);font-size:12px;line-height:1.5}
.pl-knowledge-source{display:grid;grid-template-columns:14px max-content minmax(0,1fr);gap:7px;align-items:baseline}
.pl-knowledge-source .icon{width:14px;height:14px;align-self:start;margin-top:2px}
.pl-knowledge-source>span:last-child{color:var(--text-soft)}
.pl-knowledge-footer,.pl-knowledge-credits,.pl-knowledge-credits>div,.pl-card-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-width:0}
.pl-knowledge-footer{justify-content:space-between;gap:5px 16px}
.pl-knowledge-credits{margin:0;gap:2px 18px}
.pl-knowledge-credits dt,.pl-knowledge-credits dd{margin:0}
.pl-knowledge-credits dd{color:var(--text-soft)}
.pl-card-actions{margin-inline-start:auto;justify-content:flex-end}
#project-library-host .pl-card-actions button{min-height:32px;padding:4px 9px;border:1px solid transparent;background:transparent;font-size:12px}
#project-library-host .pl-card-actions .pl-card-toggle{border-color:var(--control-border);color:var(--ink)}
.pl-card-toggle::after{content:'';display:inline-block;width:6px;height:6px;margin:0 2px 2px 7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
.pl-card-toggle[aria-expanded=true]::after{transform:rotate(225deg);margin-bottom:-1px}
.pl-card-detail,.pl-card-editor{display:grid;gap:8px;min-width:0;padding-top:10px;border-top:1px solid var(--line)}
.pl-card-detail>.pl-source-button{justify-self:start}
.pl-card-editor label{display:grid;gap:4px}
.pl-card-editor :is(input,select,textarea){min-width:0;width:100%}
@media(max-width:700px){
  #project-library-host .pl-knowledge-card{padding:13px 12px 8px;gap:9px}
  #project-library-host .pl-knowledge-head h4{font-size:16px}
  #project-library-host .pl-card-actions button{min-height:44px}
  .pl-knowledge-footer{row-gap:4px}
}

#project-library-host #pl-toggle-navigation{display:flex;align-items:center;gap:7px;flex:none;align-self:flex-start;min-height:36px;margin:0 0 6px;padding:4px 7px;border-radius:5px;color:var(--text-soft);font-size:13px}
#pl-toggle-navigation svg{width:17px;height:17px}
#pl-toggle-navigation:hover{background:var(--control-hover)}
#project-library-host #pl-doc-picker[hidden]{display:none}
#project-library-host .pl-sidebar:has(#pl-doc-picker[hidden]){height:auto;min-height:0;max-height:none;align-self:start}
@media(min-width:1001px){
 #project-library-host .pl-grid:has(#pl-doc-picker[hidden]){grid-template-columns:54px minmax(0,1fr)}
 #project-library-host .pl-sidebar:has(#pl-doc-picker[hidden]){padding:4px}
 #project-library-host #pl-toggle-navigation[aria-expanded=false]{justify-content:center;width:42px;min-height:40px;margin:0}
 #pl-toggle-navigation[aria-expanded=false]>span{display:none}
}
@media(max-width:1000px){#project-library-host #pl-toggle-navigation{min-height:44px}}

/* Keep the selected knowledge point and its own source within the same workspace. */
#project-library-host .pl-comparison{order:2;display:grid;grid-template-columns:minmax(16rem,.78fr) minmax(0,1.4fr);align-items:stretch;gap:14px;min-width:0}
#project-library-host .pl-comparison>.pl-points,#pl-source-panel{box-sizing:border-box;height:clamp(400px,72dvh,1000px);min-width:0}
#project-library-host .pl-comparison>.pl-points{order:0;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:auto;padding-right:4px}
#project-library-host .pl-comparison .pl-point{padding:12px 10px;border:1px solid transparent;border-bottom-color:var(--line);border-radius:var(--radius)}
#project-library-host .pl-comparison .pl-point.is-current{background:var(--surface-soft);border-color:var(--control-border);box-shadow:inset 3px 0 var(--accent)}
#project-library-host .pl-comparison .pl-point-review .pl-point-head{grid-template-columns:auto minmax(0,1fr) auto auto;gap:6px;align-items:center}
#project-library-host .pl-comparison .pl-point-main{margin-left:0}
#project-library-host .pl-point-link{display:block;width:100%;text-align:left;padding:0;border:0;min-height:0;background:transparent;color:inherit;font:inherit}
#project-library-host .pl-comparison .pl-edit label{min-width:0}
#project-library-host .pl-comparison .pl-edit{grid-template-columns:1fr;gap:6px}
.pl-row-source{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:6px}
.pl-row-source>span{color:var(--muted);font-size:12px;margin-right:auto;overflow-wrap:anywhere}
#pl-source-panel{display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-soft);overflow:hidden}
.pl-source-toolbar,.pl-source-heading,.pl-source-controls,.pl-source-pager{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.pl-source-heading h4{font-size:15px;margin:0}
.pl-source-heading>span,.pl-source-pager label,.pl-source-controls label{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.pl-source-toolbar{flex:none;justify-content:space-between;gap:4px 12px;min-width:0}
.pl-source-controls{margin-inline-start:auto;max-width:100%;justify-content:flex-end}
#pl-source-panel .pl-source-controls label{margin:0}
.pl-source-controls:empty{display:none}
.pl-source-controls label{display:inline-flex;gap:4px;align-items:center;min-width:0;max-width:100%}
.pl-source-pager label{white-space:nowrap}
#pl-source-position{width:4.2em;margin:0;text-align:center}
#pl-source-choice{min-width:0;max-width:210px}
#project-library-host .pl-use-location{color:var(--accent);font-weight:600}
.pl-original{flex:1;min-height:0;padding:8px;overflow:auto;overscroll-behavior:auto;background:var(--surface);border:1px solid var(--line);border-radius:var(--control-radius);overflow-wrap:anywhere}
.pl-original>img,.pl-original-row img{display:block;width:auto;max-width:100%;height:auto;margin:0 auto}
.pl-original.is-zoomed>img{max-width:none}
.pl-source-limitation{color:var(--muted);font-size:13px}
.pl-original-row{padding:8px 10px}
.pl-original-row.is-location{border-inline-start:2px solid var(--accent);background:var(--surface-soft)}
.pl-original-row>small,.pl-paragraph-end,.pl-hidden-run{color:var(--muted);font-size:12px}
.pl-original-row p{font-size:14px;line-height:1.7;white-space:pre-wrap;margin:4px 0}
.pl-original-row img{margin:6px 0}
.pl-original-row mark{background:var(--control-selected);color:var(--text);text-decoration:underline}
#project-library-host .pl-on-narrow{display:none}
@media(max-width:1000px){
 #project-library-host .pl-comparison{grid-template-columns:minmax(0,1fr);gap:10px}
 #project-library-host .pl-comparison>.pl-points{height:auto;max-height:52dvh;padding-right:2px}
 #project-library-host #pl-source-panel{height:auto;max-height:none}
 #project-library-host .pl-original{flex:auto;max-height:62dvh;min-height:100px}
 #project-library-host .pl-on-narrow{display:inline-flex}
 .pl-source-heading .pl-on-narrow{margin-left:auto}
}
@media(max-width:500px){
 #project-library-host .pl-comparison .pl-point-review .pl-point-head{grid-template-columns:auto minmax(0,1fr) auto}
 #project-library-host .pl-point-review .pl-point-head>select{grid-column:2;grid-row:2;justify-self:start}
 #project-library-host .pl-point-review .pl-point-head>button{grid-column:3;grid-row:1/3}
}
.pl-word-limit{display:block;margin:10px;color:var(--muted);font-size:12px}
#project-library-host .pl-comparison .pl-edit label{margin:0}
#project-library-host .pl-comparison .pl-edit textarea{min-height:64px}

#pl-original-reader{width:min(96vw,98rem);max-width:96vw;height:92dvh;max-height:94dvh;box-sizing:border-box;padding:16px;color:var(--ink);background:var(--surface)}
#pl-original-reader[open]{display:flex;flex-direction:column;gap:8px}
#pl-original-reader header,.pl-reader-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#pl-original-reader header h2{flex:1;min-width:0;margin:0;overflow-wrap:anywhere;font-size:1.25rem}
.pl-reader-citation{margin:0;color:var(--muted);overflow-wrap:anywhere}
.pl-reader-tools label{display:inline-flex;align-items:center;gap:4px;margin:0;white-space:nowrap}
.pl-reader-tools input{width:4.5em;margin:0;text-align:center}
.pl-reader-content{min-height:0;flex:1;display:flex;flex-direction:column;overflow:auto}
.pl-reader-content .pl-original{min-height:0;max-height:none}
.pl-pdf-page{position:relative;max-width:100%;width:fit-content;margin:auto;line-height:0}
.pl-pdf-page img{display:block;max-width:100%;height:auto}
.pl-pdf-page svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:#ffbf0070}
.pl-original.is-zoomed .pl-pdf-page,.pl-original.is-zoomed .pl-pdf-page img{max-width:none}
.pl-original-row mark,.pl-cited-paragraph{background:#ffe18b;color:#302510;border-radius:2px}
.pl-original-row .pl-cited-paragraph{padding:4px 6px}
@media(max-width:700px){#pl-original-reader{width:98vw;max-width:98vw;padding:10px}.pl-reader-tools button,.pl-source-heading button{min-height:44px}}
