.admin-top{padding-right:max(28px,calc((100% - 1290px)/2));padding-left:max(28px,calc((100% - 1290px)/2))}.page-content{width:min(1290px,100%);padding:20px 28px 55px}.document-studio{display:grid;grid-template-columns:215px minmax(0,1fr) 215px;min-height:760px;overflow:hidden;border:1px solid var(--line);border-radius:17px;background:#fff;box-shadow:0 12px 38px rgba(38,59,91,.07)}.document-manager,.document-settings{padding:18px;background:#f8fafc}.document-manager{border-right:1px solid var(--line)}.document-settings{border-left:1px solid var(--line)}.studio-side-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.studio-side-title h2,.document-settings h2{margin:0;color:var(--ink);font-size:15px}.studio-side-title button{display:grid;width:34px;height:34px;padding:0;place-items:center;border:0;border-radius:9px;color:#fff;background:var(--ink);font-size:20px}.studio-upload{display:grid;gap:7px;margin-bottom:18px;padding:12px;border:1px dashed #9ab4d9;border-radius:11px;color:#506b90;background:#f2f7fe;font-size:11px}.studio-upload select,.studio-upload input{width:100%;min-height:38px;padding:0 9px;border:1px solid var(--line);border-radius:8px;background:#fff}.studio-upload button{min-height:38px;border:0;border-radius:8px;color:#fff;background:#356ebd;font-weight:700}.document-manager-list{display:grid;gap:5px;max-height:570px;overflow:auto}.document-manager-list button{display:block;width:100%;padding:10px;border:0;border-radius:9px;color:#66768f;background:transparent;text-align:left}.document-manager-list button:hover,.document-manager-list button.active{color:#1d5da8;background:#eaf2ff}.document-manager-list strong,.document-manager-list small{display:block}.document-manager-list strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.document-manager-list small{margin-top:4px;color:#8a97a9;font-size:9px}.document-editor-area{min-width:0}.editor-document-top{display:flex;min-height:67px;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;border-bottom:1px solid var(--line)}.editor-document-top input{min-width:0;width:55%;border:0;outline:0;color:var(--ink);font-size:18px;font-weight:700}.editor-status{color:#8793a6;font-size:10px}.editor-actions{display:flex;gap:7px}.editor-actions button{min-height:40px;padding:0 13px;border-radius:9px;font-weight:700}.editor-actions .preview-document{border:1px solid var(--line);color:#52647d;background:#fff}.editor-actions .save-document{border:0;color:#fff;background:var(--ink)}.rich-toolbar{display:flex;min-height:54px;align-items:center;gap:3px;padding:7px 14px;overflow-x:auto;border-bottom:1px solid var(--line);background:#fbfcfe}.rich-toolbar button,.rich-toolbar select{min-width:36px;height:36px;padding:0 8px;border:0;border-radius:7px;color:#54657e;background:transparent;font-size:12px;white-space:nowrap}.rich-toolbar button:hover,.rich-toolbar button.active{color:#1e5fae;background:#eaf2ff}.rich-toolbar .formula-button{color:#1f61b5;background:#edf5ff;font-family:"Times New Roman",serif}.rich-toolbar i{width:1px;height:24px;margin:0 4px;background:#e1e7ef}.editor-scroll{padding:26px;background:#f6f8fb}.document-summary-input{display:block;width:100%;min-height:58px;margin-bottom:12px;padding:12px 15px;border:1px solid var(--line);border-radius:10px;color:#61718a;resize:vertical}.rich-editor{min-height:550px;padding:38px 42px;border:1px solid #e1e7ef;border-radius:12px;outline:0;color:#465a74;background:#fff;box-shadow:0 10px 30px rgba(38,59,91,.05);font-size:15px;line-height:1.85}.rich-editor:focus{border-color:#79a2db;box-shadow:0 0 0 3px rgba(57,121,238,.12)}.rich-editor h2{margin:30px 0 12px;color:#183963;font-size:22px}.rich-editor h3{margin:24px 0 10px;color:#2b4c70;font-size:17px}.rich-editor p{margin:11px 0}.rich-editor blockquote{margin:18px 0;padding:13px 15px;border-left:3px solid #4c87da;background:#f2f7fe}.rich-editor table{width:100%;border-collapse:collapse}.rich-editor td{padding:8px;border:1px solid var(--line)}.rich-editor .formula-block{margin:20px 0;padding:20px;overflow-x:auto;border:2px solid #6a9de5;border-radius:11px;background:#fafdff;text-align:center}.rich-editor .math-inline{display:inline-block;padding:0 3px}.rich-editor [data-latex]{cursor:pointer}.settings-field{display:grid;gap:6px;margin:15px 0;color:#697a92;font-size:10px;font-weight:700}.settings-field input,.settings-field select{width:100%;min-height:41px;padding:0 10px;border:1px solid var(--line);border-radius:9px;color:#52637c;background:#fff}.setting-hint{margin-top:22px;padding:12px;border-radius:10px;color:#65758d;background:#edf4fd;font-size:10px;line-height:1.6}.setting-buttons{display:grid;gap:8px;margin-top:18px}.setting-buttons button{min-height:41px;border-radius:9px;font-weight:700}.create-collection{border:1px solid #91aed8;color:#2864b4;background:#f1f6fd}.delete-document{border:0;color:#b43c43;background:#fff0f1}.formula-dialog{display:grid;position:fixed;z-index:220;inset:0;padding:16px;place-items:center;background:rgba(18,35,60,.48);backdrop-filter:blur(5px)}.formula-card{width:min(530px,100%);padding:22px;border-radius:15px;background:#fff;box-shadow:0 25px 75px rgba(19,39,72,.3)}.formula-card h2{margin:0;color:var(--ink);font-size:19px}.formula-card p{margin:7px 0 16px;color:var(--muted);font-size:11px}.formula-card textarea{width:100%;min-height:88px;padding:12px;border:1px solid var(--line);border-radius:10px;resize:vertical;font-family:"SFMono-Regular",Consolas,monospace}.formula-preview{min-height:74px;margin:12px 0;padding:18px;overflow-x:auto;border-radius:10px;background:#f5f8fc;text-align:center}.formula-card-actions{display:flex;justify-content:flex-end;gap:8px}.formula-card-actions button{min-height:42px;padding:0 14px;border-radius:9px;font-weight:700}.formula-cancel{border:1px solid var(--line);background:#fff}.formula-insert{border:0;color:#fff;background:var(--ink)}
.document-module-tabs{display:flex;gap:8px;margin-bottom:14px;padding:5px;border:1px solid var(--line);border-radius:12px;background:#fff}.document-module-tabs a{display:grid;min-height:44px;padding:0 18px;place-items:center;border-radius:9px;color:#687a93;font-size:12px;font-weight:800}.document-module-tabs a:hover{background:#f0f5fc}.document-module-tabs a.active{color:#fff;background:var(--ink);box-shadow:0 7px 18px rgba(16,45,103,.18)}
.editor-document-top input{width:auto;flex:1}.editor-status{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-actions button{min-width:68px;white-space:nowrap}
@media(max-width:1120px){.document-studio{grid-template-columns:190px minmax(0,1fr)}.document-settings{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,1fr);gap:10px;border-top:1px solid var(--line);border-left:0}.document-settings h2,.setting-hint,.setting-buttons{grid-column:1/-1}.settings-field{margin:0}.setting-buttons{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.admin-top{padding-right:12px;padding-left:12px}.page-content{padding:12px 8px 42px}.document-studio{display:block;min-height:0;border-radius:13px}.document-manager{border-right:0;border-bottom:1px solid var(--line)}.document-manager-list{display:flex;max-height:none;overflow-x:auto}.document-manager-list button{min-width:150px}.studio-upload{grid-template-columns:1fr 1fr}.studio-upload label:first-child{grid-column:1/-1}.editor-document-top{align-items:flex-start;flex-wrap:wrap}.editor-document-top input{width:100%;font-size:16px}.editor-actions{width:100%}.editor-actions button{flex:1}.editor-scroll{padding:12px}.rich-editor{min-height:500px;padding:25px 18px;font-size:16px}.document-settings{display:grid;grid-template-columns:1fr 1fr;padding:15px}.document-settings h2,.setting-hint,.setting-buttons{grid-column:1/-1}.rich-toolbar{padding-inline:8px}.rich-toolbar button,.rich-toolbar select{min-width:40px;height:40px}.formula-card{padding:18px}}
@media(max-width:430px){.studio-upload,.document-settings{grid-template-columns:1fr}.studio-upload label:first-child,.document-settings h2,.setting-hint,.setting-buttons{grid-column:auto}.rich-editor{padding:22px 16px}.editor-status{display:none}}

/* Hierarchical document tree, outline and extended rich-text controls */
@media(min-width:1121px){.page-content{width:min(1380px,100%)}.document-studio{grid-template-columns:255px minmax(0,1fr) 235px}}
.studio-upload{grid-template-columns:1fr 1fr}.studio-upload label{display:grid;gap:5px}.studio-upload label:first-child,.studio-upload button{grid-column:1/-1}
.document-tree{align-content:start}.document-tree-subject,.document-tree-node{display:block}.document-subject-toggle,.document-tree-toggle{display:flex!important;min-height:42px!important;align-items:center!important;gap:6px!important}.document-subject-toggle{color:#264d7b!important;background:#edf4fd!important}.document-tree-toggle{padding-left:8px!important}.document-subject-toggle .tree-chevron,.document-tree-toggle .tree-chevron{display:inline-block;flex:0 0 14px;font-size:18px;line-height:1;transition:transform .18s ease}.document-tree-subject.open>.document-subject-toggle .tree-chevron,.document-tree-node.open>.document-tree-toggle .tree-chevron{transform:rotate(90deg)}.document-subject-toggle small,.document-tree-toggle small{margin-left:auto}.document-subject-children,.document-tree-children{display:none;margin-left:9px;padding-left:7px;border-left:1px solid #dce5f1}.document-tree-subject.open>.document-subject-children,.document-tree-node.open>.document-tree-children{display:block}.document-tree-file{min-height:48px;padding-left:13px!important}.document-tree-file strong{white-space:normal!important;line-height:1.35}
.rich-toolbar button,.rich-toolbar select,.editor-color{min-height:40px}.editor-color{display:flex;align-items:center;gap:5px;padding:0 8px;border-radius:7px;color:#54657e;font-size:12px;white-space:nowrap}.editor-color input{width:23px;height:23px;padding:1px;border:1px solid #d9e1ec;border-radius:6px;background:#fff}.rich-editor h1{margin:34px 0 14px;color:#102d57;font-size:27px}.rich-editor h3{font-size:18px}.rich-editor h4{font-size:16px}.rich-editor h5{font-size:15px}.rich-editor h6{font-size:14px}.rich-editor h4,.rich-editor h5,.rich-editor h6{margin:20px 0 8px;color:#38536f}.rich-editor blockquote.note-callout{border-left-width:5px;border-left-color:#82a9dc;background:#eef5fd;font-weight:600}
.collection-path{margin:-8px 0 10px;padding:9px 10px;border-radius:8px;color:#315f9f;background:#edf4fd;font-size:10px;line-height:1.5}.editor-outline{margin-top:18px;padding:11px;border:1px solid #dfe7f1;border-radius:10px;background:#fff}.editor-outline>strong{display:block;margin-bottom:8px;color:#526780;font-size:10px}.editor-outline>div{color:#8b97a8;font-size:9px;line-height:1.5}.editor-outline button{display:block;width:100%;min-height:32px;padding:4px 5px 4px calc(5px + min(var(--outline-depth,0),4) * 10px);overflow:hidden;border:0;border-radius:6px;color:#64758c;background:transparent;text-align:left;text-overflow:ellipsis;white-space:nowrap}.editor-outline button:hover{color:#1f5fae;background:#edf4fd}.editor-outline button span{margin-right:6px;color:#8aa0bc;font-size:8px}.setting-hint{margin-top:14px}
@media(max-width:760px){.studio-upload{grid-template-columns:1fr 1fr}.studio-upload label:first-child,.studio-upload button{grid-column:1/-1}}
@media(max-width:430px){.studio-upload{grid-template-columns:1fr}.studio-upload label:first-child,.studio-upload button{grid-column:auto}}
@media(prefers-reduced-motion:reduce){.tree-chevron{transition:none!important}}

/* Keep the desktop editor toolbar readable in two deliberate rows. */
@media(min-width:761px){.rich-toolbar{min-height:96px;flex-wrap:wrap;align-content:center;overflow-x:hidden}.rich-toolbar>i:nth-of-type(2){width:0;height:0;flex:0 0 100%;margin:0;background:transparent}.rich-toolbar button,.rich-toolbar select,.rich-toolbar .editor-color{flex:0 0 auto}}

/* Keep formatting controls visible and match the requested body leading. */
.document-studio{overflow:clip}.rich-toolbar{position:sticky;z-index:18;top:76px;box-shadow:0 8px 18px rgba(29,57,94,.08)}.rich-editor{line-height:1.5}.rich-editor p{line-height:1.5}.rich-toolbar button[aria-pressed="true"]{color:#1e5fae;background:#eaf2ff}
@media(max-width:760px){.rich-toolbar{top:76px}}
