/* Isolated NovaStudy Course & Notes Manager styles: Cyber and Black & Gold friendly */
.cm-root{display:grid;gap:17px;margin-bottom:26px}
.cm-root button{cursor:pointer}
.cm-root h2{font-size:1.18rem;margin:0 0 12px}
.cm-root h3{font-size:1.04rem;margin:18px 0 12px}
.cm-root p{line-height:1.65}
.cm-root .cm-panel{padding:22px;border-radius:16px}
.cm-tabs,.cm-course-pills{display:flex;gap:9px;flex-wrap:wrap}
.cm-tabs button,.cm-course-pills button{border-radius:10px}
.cm-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.cm-stats>span{display:flex;flex-direction:column;gap:4px;padding:13px 18px;border:1px solid var(--line,#3c5065);border-radius:12px;background:var(--panel,#101b2c);color:var(--muted,#a7b1c2)}
.cm-stats b{font-size:22px;color:var(--text,#e8f4ff)}
.cm-panel{background:var(--panel,#141e2b);color:var(--text,#edf4ff)}
.cm-panel input,.cm-panel textarea{display:block;width:100%;max-width:100%;margin-top:7px;background:var(--panel2,#1d2a3c);border:1px solid var(--line,#3d5269);color:var(--text,#edf4ff);padding:11px 13px;border-radius:10px;font:inherit}
.cm-panel input:focus-visible,.cm-panel textarea:focus-visible{outline:2px solid var(--mint,#58d6ce);outline-offset:1px}
.cm-panel .cm-form{display:grid;gap:14px;max-width:700px}
.cm-panel label{display:block;font-weight:650;font-size:13px}
.cm-panel .cm-form button{justify-self:start}
.cm-panel button{max-width:100%}
.cm-muted{color:var(--muted,#a8bac7);font-size:13px}
.cm-message{padding:12px 16px;border:1px solid var(--line,#344);border-radius:10px;background:var(--panel2,#17263b);color:var(--mint,#59c);word-break:break-word}
.cm-flex{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.cm-flex h2,.cm-flex h3{margin:0}
.cm-invite{display:flex;align-items:center;gap:11px;flex-wrap:wrap;margin:18px 0;padding:13px;border-radius:11px;border:1px solid var(--line,#334);background:var(--panel2,#263)}
.cm-invite code{font-size:12px;overflow-wrap:anywhere;color:var(--mint,#8fc)}
.cm-inline{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin:12px 0}
.cm-inline input{flex:1;min-width:min(100%,180px);margin:0}
.cm-member{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line,#344);padding:9px 0}
.cm-members{margin:10px 0 24px}
.cm-members summary,.cm-chapter summary{cursor:pointer}
.cm-chapter{border:1px solid var(--line,#344);border-radius:12px;margin:12px 0;overflow:hidden;background:var(--panel2,#172839)}
.cm-chapter>summary{list-style:none;padding:15px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.cm-chapter>summary::-webkit-details-marker{display:none}
.cm-chapter>summary>span{color:var(--muted,#abc);font-size:12px}
.cm-chapter-inner{padding:17px;border-top:1px solid var(--line,#344)}
.cm-upload{margin:10px 0 16px;display:inline-flex!important;align-items:center;border:1px dashed var(--mint,#5fb);border-radius:11px;padding:11px 13px;color:var(--mint,#5fb);cursor:pointer;font-size:12px}
.cm-upload input{width:1px;height:1px;opacity:0;overflow:hidden;position:absolute}
.cm-upload:focus-within{outline:2px solid var(--mint,#5fb)}
.cm-topic-list{display:grid;gap:12px;margin-top:15px}
.cm-topic{padding:16px;border:1px solid var(--line,#344);border-radius:11px;background:var(--panel,#102033)}
.cm-topic .cm-form{margin:10px 0}
.cm-topic .cm-form textarea{width:100%}
.cm-body{white-space:pre-wrap;overflow-wrap:anywhere}
.cm-files{display:grid;gap:7px;margin:10px 0}
.cm-file{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;border-radius:10px;border:1px solid var(--line,#344)}
.cm-file span{overflow-wrap:anywhere;min-width:0}
.cm-assignment{border:1px solid var(--line,#344);border-radius:12px;padding:18px;margin-top:15px;background:var(--panel2,#182c42)}
.cm-assignment .cm-form{margin-top:12px}
.cm-submitted{border-top:1px solid var(--line,#344);padding:14px 0;display:grid;gap:6px;white-space:pre-wrap;overflow-wrap:anywhere}
.cm-submitted small{color:var(--muted,#abc)}
.cm-submitted p{margin:3px 0}
.cm-legacy{border:1px solid var(--line,#344);border-radius:12px;padding:14px;margin-top:22px}
.cm-legacy>summary{cursor:pointer;font-weight:700;color:var(--muted,#abc)}
.cm-legacy .page-head{padding-top:20px}
@media(max-width:800px){.cm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.cm-panel{padding:15px!important}.cm-invite{align-items:flex-start;flex-direction:column}.cm-tabs button{flex:1 1 145px}.cm-root{gap:12px}}
@media(max-width:480px){.cm-stats b{font-size:18px}.cm-stats>span{padding:12px}.cm-chapter>summary{padding:11px;flex-direction:column;align-items:start}.cm-inline{display:grid}.cm-inline>*{width:100%}.cm-legacy{margin-bottom:80px}}

/* Notes and file management — v3.5 owner-only controls */
.cm-file-item{min-width:0;overflow:hidden;border:1px solid var(--line,#344);border-radius:11px}
.cm-file-item .cm-file{border:0;border-radius:0;gap:14px;flex-wrap:wrap}
.cm-file-title{display:flex;align-items:center;gap:7px;min-width:0;flex:1 1 190px;overflow-wrap:anywhere}
.cm-file-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.cm-file-actions button{min-height:36px;padding:7px 13px;white-space:nowrap}
.cm-asset-editor{display:grid;gap:13px;max-width:100%!important;padding:17px;border-top:1px solid var(--line,#344);background:var(--panel2,#1d2a3c)}
.cm-asset-editor label{font-size:13px}
.cm-asset-editor input{width:100%}
.cm-asset-editor .cm-file-actions{justify-content:flex-start}
.cm-delete-confirm{padding:14px 17px;border-top:1px solid var(--line,#344);background:var(--panel2,#1d2a3c)}
.cm-delete-confirm p{margin:0 0 12px;font-size:13px}
.cm-delete-confirm .cm-file-actions{justify-content:flex-start}
.cm-file-actions .danger-btn{background:rgba(220,60,73,.12);color:#f8a5a5;border:1px solid rgba(224,89,94,.6);border-radius:10px}
.cm-file-actions .danger-btn:hover{background:rgba(220,60,73,.22)}
@media(max-width:620px){.cm-file-item .cm-file{align-items:stretch}.cm-file-actions{justify-content:flex-start;width:100%}.cm-file-actions button{flex:1 0 auto}.cm-asset-editor,.cm-delete-confirm{padding:13px}}

/* Chapter, topic and written-note owner actions */
.cm-section-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.cm-section-heading b{overflow-wrap:anywhere;min-width:0}
.cm-section-actions{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:8px;margin:10px 0}
.cm-section-actions button{min-height:36px;padding:8px 13px;border-radius:9px;white-space:normal;line-height:1.3;text-align:center}
.cm-section-actions .danger-btn{background:rgba(220,60,73,.12);color:#f8a5a5;border:1px solid rgba(224,89,94,.6)}
.cm-section-actions .danger-btn:hover{background:rgba(220,60,73,.22)}
.cm-chapter-inner>.cm-section-actions{margin:0 0 15px}
.cm-inline-editor{max-width:750px!important;margin:12px 0 20px;padding:15px;border-radius:11px;border:1px solid var(--line,#344);background:var(--panel2,#1d2a3c)}
.cm-inline-editor label,.cm-note-editor label{display:block;width:100%;font-size:13px}
.cm-inline-editor .cm-section-actions,.cm-note-editor .cm-section-actions{margin:0}
.cm-chapter-inner>h3{margin:16px 0 12px}
.cm-note-block{margin:14px 0 8px;padding:13px 15px;border-radius:10px;border:1px solid var(--line,#344);background:var(--panel2,#172839)}
.cm-note-block>strong{display:block;font-size:13px;margin-bottom:9px}
.cm-note-block .cm-note-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 12px;line-height:1.6}
.cm-note-block .cm-note-editor{display:grid;gap:13px;margin:8px 0 0}
.cm-note-block .cm-note-editor textarea{min-height:140px;resize:vertical}
.cm-topic>.cm-section-heading .cm-section-actions{margin:0}
.cm-delete-confirm .cm-section-actions{margin:0}
@media(max-width:600px){
 .cm-section-heading{align-items:flex-start;flex-direction:column}
 .cm-section-heading .cm-section-actions{width:100%}
 .cm-section-actions button{flex:1 1 auto;min-height:40px}
 .cm-note-block{padding:12px}
 .cm-inline-editor{padding:12px}
}

/* v3.5.3 — compact contextual actions on the same heading row */
.cm-chapter-shell{position:relative;min-width:0;margin:12px 0}
.cm-chapter-shell>.cm-chapter{margin:0}
.cm-chapter-shell>.cm-chapter>summary{
  min-height:53px;justify-content:flex-start;gap:12px;padding-right:174px
}
.cm-chapter-shell>.cm-chapter>summary>strong{
  min-width:0;overflow-wrap:anywhere;flex:0 1 auto
}
.cm-chapter-shell>.cm-chapter>summary>span{
  flex:0 0 auto;white-space:nowrap;font-size:11px
}
.cm-chapter-header-actions{
  position:absolute;z-index:2;top:8px;right:12px;
  display:flex;align-items:center;gap:12px
}
.cm-section-actions.cm-compact-actions{
  display:flex;align-items:center;justify-content:flex-end;
  width:auto;gap:12px;margin:0;flex-wrap:nowrap
}
.cm-compact-actions button,
.cm-section-actions.cm-compact-actions button{
  flex:0 0 auto;white-space:nowrap;min-height:35px;
  padding:7px 12px;font-size:12px;border-radius:9px
}
.cm-topic>.cm-section-heading,
.cm-note-block>.cm-note-heading{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  gap:12px;align-items:center;justify-content:stretch
}
.cm-topic>.cm-section-heading .cm-compact-actions{width:auto}
.cm-note-block>.cm-note-heading{margin-bottom:13px}
.cm-note-block>.cm-note-heading>strong{margin:0}
@media(max-width:600px){
 .cm-chapter-shell>.cm-chapter>summary{
  padding:10px 145px 10px 12px;min-height:56px;
  align-items:flex-start;flex-direction:column;gap:3px
 }
 .cm-chapter-header-actions{top:8px;right:10px;gap:8px}
 .cm-compact-actions button,.cm-section-actions.cm-compact-actions button{
  flex:0 0 auto;min-height:33px;padding:7px 9px;font-size:11px
 }
 .cm-topic>.cm-section-heading,.cm-note-block>.cm-note-heading{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:center;gap:8px
 }
 .cm-section-heading .cm-compact-actions{width:auto}
}

/* v3.5.4 — structural chapter header (no overlays or controls outside the row) */
.cm-root .cm-chapter-shell{
  display:block;position:relative;overflow:hidden;
  border:1px solid var(--line,#344);border-radius:12px;
  background:var(--panel2,#172839);margin:12px 0
}
.cm-root .cm-chapter-heading{
  display:flex;align-items:center;justify-content:space-between;
  width:100%;min-height:56px;gap:12px;padding:10px 14px
}
.cm-root .cm-chapter-toggle{
  display:flex;align-items:center;justify-content:flex-start;
  flex:1 1 auto;min-width:0;min-height:36px;width:auto;
  gap:12px;padding:4px 0;
  background:transparent;border:0;border-radius:4px;box-shadow:none;
  font:inherit;color:var(--text,#edf4ff);text-align:left;cursor:pointer
}
.cm-root .cm-chapter-toggle strong{
  font-size:13px;line-height:1.4;min-width:0;overflow-wrap:anywhere
}
.cm-root .cm-chapter-toggle .cm-chapter-topic-count{
  flex:0 0 auto;font-size:11px;font-weight:400;
  color:var(--muted,#abc);white-space:nowrap
}
.cm-root .cm-chapter-toggle:focus-visible{
  outline:2px solid var(--mint,#58d6ce);outline-offset:3px
}
.cm-root .cm-chapter-header-actions,
.cm-root .cm-chapter-heading>.cm-chapter-header-actions{
  position:static;inset:auto;z-index:auto;
  flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;
  gap:12px;max-width:100%;margin:0
}
.cm-root .cm-chapter-inner{border-top:1px solid var(--line,#344);padding:17px}
.cm-root .cm-chapter-inner[hidden]{display:none!important}
@media(max-width:600px){
 .cm-root .cm-chapter-heading{gap:9px;padding:9px 10px;min-height:50px}
 .cm-root .cm-chapter-toggle{gap:6px;flex-wrap:wrap}
 .cm-root .cm-chapter-header-actions{gap:8px}
 .cm-root .cm-chapter-toggle strong{font-size:12px}
 .cm-root .cm-chapter-inner{padding:13px}
}

/* v3.5.5 — teacher course utilities, compact right-aligned buttons */
.cm-root .cm-course-header{
 display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:16px;
 width:100%;min-width:0
}
.cm-root .cm-course-title{flex:1 1 210px;min-width:0}
.cm-root .cm-course-title h2{overflow-wrap:anywhere}
.cm-root .cm-course-actions{
 display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;
 flex:0 1 auto;gap:12px;max-width:100%
}
.cm-root .cm-course-actions button{
 min-height:37px;padding:8px 12px;white-space:nowrap;border-radius:9px;
 font-size:12px;line-height:1.2;flex:0 0 auto
}
.cm-root .cm-course-actions button[aria-expanded="true"]{
 border-color:var(--mint,#58d6ce);color:var(--mint,#58d6ce)
}
.cm-root .cm-owner-panel{
 margin:14px 0 2px;padding:15px;border:1px solid var(--line,#344);
 border-radius:11px;background:var(--panel2,#192b40);min-width:0;
}
.cm-root .cm-owner-panel.cm-invite{
 display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:12px
}
.cm-root .cm-owner-panel.cm-invite code{overflow-wrap:anywhere;word-break:break-word}
.cm-root .cm-owner-panel.cm-members h3{margin:0 0 8px}
.cm-root .cm-owner-panel.cm-members .cm-member:last-child{border-bottom:0}
@media(max-width:660px){
 .cm-root .cm-course-header{gap:12px}
 .cm-root .cm-course-title{flex-basis:100%}
 .cm-root .cm-course-actions{width:100%;justify-content:flex-end;gap:9px}
 .cm-root .cm-course-actions button{font-size:11px;padding:9px 10px}
 .cm-root .cm-owner-panel{padding:12px}
}
@media(max-width:360px){
 .cm-root .cm-course-actions{gap:8px}
 .cm-root .cm-course-actions button{white-space:normal}
}


/* Per-course owner controls — edit/delete in the existing course header (v3.5.17). */
.cm-root .cm-course-actions .danger-btn{
 color:#ffd8df;
 background:color-mix(in srgb,var(--panel,#19152d) 78%,#9e2d4d);
 border:1px solid #d7647c;
}
.cm-root .cm-course-actions .danger-btn:hover{
 background:#82334d;
 border-color:#ff879e;
}
.cm-root .cm-course-utility{
 margin:16px 0;
 padding:18px;
 border:1px solid var(--line,#66568a);
 border-radius:14px;
 background:var(--panel2,#19152d);
}
.cm-root .cm-course-utility h3{margin:0 0 12px}
.cm-root .cm-course-utility label{display:grid;gap:7px;font-weight:700;min-width:0}
.cm-root .cm-course-utility input,
.cm-root .cm-course-utility textarea{
 max-width:100%;
 width:100%;
}
.cm-root .cm-course-form-actions{
 display:flex;
 align-items:center;
 flex-wrap:wrap;
 gap:10px;
 margin-top:10px;
}
.cm-root .cm-course-form-actions button{min-height:40px}
.cm-root .cm-course-delete{
 border-color:#c85f79;
 background:color-mix(in srgb,var(--panel2,#19152d) 88%,#842d49);
}
.cm-root .cm-course-delete p{
 line-height:1.7;
 color:var(--text,#f1f4ff);
 max-width:75ch;
}
.cm-root .cm-course-delete label strong{
 overflow-wrap:anywhere;
}
.cm-root .cm-course-delete .danger-btn{
 background:#92344b;
 color:#fff;
 border-color:#e37d96;
}
.cm-root .cm-course-utility :is(input,textarea,button):focus-visible{
 outline:2px solid var(--mint,#5fd6e2);
 outline-offset:2px;
}
@media(max-width:660px){
 .cm-root .cm-course-actions button{
  min-height:40px;
  flex:0 1 auto;
 }
 .cm-root .cm-course-utility{padding:13px}
 .cm-root .cm-course-form-actions button{
  flex:1 1 125px;
 }
}

/* Course resources: responsive standalone file and folder pickers. */
.cm-upload-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:8px 0 14px}
.cm-upload-row .cm-upload{margin:0}
.cm-upload-help{flex-basis:100%;color:var(--muted,#a8bac7);font-size:11px;line-height:1.5}
@media(max-width:520px){.cm-upload-row .cm-upload{width:100%;justify-content:center;text-align:center}}
