/* Exercise editor and dark-mode editor surfaces. Cascade order is defined in index.html. */

/* New Exercise — clearer dark surfaces and hierarchy */
html[data-theme="dark"] .editor-shell{color:#eaf0f8!important}
html[data-theme="dark"] .editor-topbar{
  background:rgba(17,26,42,.97)!important;border-color:#34445b!important;
  box-shadow:0 10px 30px rgba(0,0,0,.28)!important
}
html[data-theme="dark"] .editor-status-badge{background:#243149!important;color:#d8e3f2!important;border:1px solid #3a4b64!important}
html[data-theme="dark"] #saveState{color:#91a0b5!important}
html[data-theme="dark"] .editor-meta-card,
html[data-theme="dark"] .editor-source-card{
  background:#121c2c!important;border-color:#33435a!important;box-shadow:none!important
}
html[data-theme="dark"] .editor-meta-card label,
html[data-theme="dark"] .editor-field-label{color:#dbe5f2!important}
html[data-theme="dark"] .editor-meta-card input,
html[data-theme="dark"] .editor-meta-card select,
html[data-theme="dark"] .editor-source-panel textarea{
  background:#0d1625!important;color:#eef3f9!important;border-color:#40516a!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.015)!important
}
html[data-theme="dark"] .editor-source-head .small,
html[data-theme="dark"] .editor-source-panel>.small,
html[data-theme="dark"] .editor-empty-structure{color:#aab7ca!important}
html[data-theme="dark"] .editor-source-tabs{background:#121c2c!important}
html[data-theme="dark"] .editor-source-tab{background:#1b2940!important;color:#c5d0df!important;border:1px solid #34465f!important;border-bottom:0!important}
html[data-theme="dark"] .editor-source-tab.active{background:#2f66e8!important;color:#fff!important;border-color:#477cf0!important}
html[data-theme="dark"] .editor-source-panel{background:#121c2c!important;border-color:#34445b!important}
html[data-theme="dark"] .editor-import-success{
  background:#112b23!important;border-color:#286b50!important;color:#c8f2dc!important
}
html[data-theme="dark"] .editor-import-success strong{color:#79dfa8!important}
html[data-theme="dark"] .editor-import-success .small{color:#9fcdb6!important}
html[data-theme="dark"] .editor-structure{background:#121c2c!important;border-color:#34445b!important}
html[data-theme="dark"] .editor-structure>summary{background:#162236!important;color:#e7edf6!important}
html[data-theme="dark"] .editor-structure-summary{color:#a9b7ca!important}
html[data-theme="dark"] .editor-structure-body{background:#101a29!important;border-color:#34445b!important}
html[data-theme="dark"] .editor-more summary,
html[data-theme="dark"] .editor-more-menu{background:#17243a!important;border-color:#3b4d67!important;color:#e7edf6!important}
html[data-theme="dark"] .editor-more-menu button:hover{background:#21314a!important}
html[data-theme="dark"] .editor-file-drop{background:#0e1828!important;border-color:#465a76!important}
html[data-theme="dark"] .editor-pdf-note{background:#332b16!important;color:#f0d88a!important;border:1px solid #655527!important}
html[data-theme="dark"] .editor-layout-choice{background:#152238!important;border-color:#3a4b64!important;color:#dce6f3!important}
html[data-theme="dark"] .editor-preview-modal{background:#0b1320!important}
html[data-theme="dark"] .editor-preview-modal-head{background:rgba(11,19,32,.96)!important}

/* Exam action bar — align exactly with the whole exercise shell */
.exam-v5-2 .exam-actions{
  left:0!important;right:0!important;width:100%!important;box-sizing:border-box!important;
  padding:10px 14px!important;border-radius:0 0 14px 14px!important;
}
.exam-v5-2.parts-collapsed .exam-actions{left:0!important}
html[data-theme="dark"] .exam-v5-2 .exam-actions{
  background:rgba(15,24,39,.98)!important;border-color:#304159!important
}
@media(max-width:800px){.exam-v5-2 .exam-actions{left:0!important;right:0!important;width:100%!important}}


/* =========================================================
   v5.4 — password dark mode + full-height exam + dedup title
   ========================================================= */

/* Change Password: true dark modal instead of a white card with pale text. */
html[data-theme="dark"] #passwordPanel.pw-panel:not(.hide){
  background:#111927!important;
  border-color:#334155!important;
  color:#e7edf6!important;
  box-shadow:0 28px 90px rgba(0,0,0,.55)!important;
}
html[data-theme="dark"] #passwordPanel h2,
html[data-theme="dark"] #passwordPanel label{
  color:#e7edf6!important;
}
html[data-theme="dark"] #passwordPanel input{
  background:#0d1522!important;
  color:#eef3f9!important;
  border:1px solid #40516a!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #passwordPanel input::placeholder{color:#8492a6!important}
html[data-theme="dark"] #passwordPanel input:focus{
  border-color:#6ea8ff!important;
  outline:2px solid rgba(110,168,255,.22)!important;
  outline-offset:1px!important;
}
html[data-theme="dark"] #passwordPanel button:not(.primary){
  background:#1c293a!important;
  color:#e6edf7!important;
  border:1px solid #35465d!important;
}
html[data-theme="dark"] #passwordPanel .primary{
  background:#2f63e9!important;
  color:#fff!important;
}
html[data-theme="dark"] body.password-open:after{
  background:rgba(5,10,18,.72)!important;
  backdrop-filter:blur(4px)!important;
}

/* Assignment exam: let flexbox own the remaining viewport height.
   This avoids the unused white strip below the exam. */
body.exercise-focus .app-main{
  height:100dvh!important;
  min-height:100dvh!important;
}
body.exercise-focus #studentWorkView{
  height:100%!important;
  min-height:0!important;
}
body.exercise-focus #studentWorkView>.card{
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
body.exercise-focus .student-work-head{flex:0 0 auto!important;margin:0!important}
body.exercise-focus #studentScore{flex:0 0 auto!important;margin:0!important}
body.exercise-focus #studentPreview{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.exercise-focus #studentPreview>.exam-shell,
body.exercise-focus #studentPreview>.exam-v5{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
}
body.exercise-focus .exam-body{flex:1 1 auto!important;min-height:0!important}
body.exercise-focus .exam-sections,
body.exercise-focus .exam-section.active,
body.exercise-focus .exam-unified-split{height:100%!important;min-height:0!important}

/* The assignment header already shows the title. Hide the duplicate title row
   inside Exam Mode and keep the global navigator + part tabs. */
body.exercise-focus #studentPreview .exam-v5 .exam-summary{display:none!important}
body.exercise-focus #studentPreview .exam-v5 .exam-top{padding-top:0!important}

/* Slightly denser assignment header so more vertical space belongs to the exam. */
body.exercise-focus .student-work-head{min-height:42px!important;padding:5px 12px!important}
body.exercise-focus .student-work-head h2{line-height:1.15!important}

@media(max-width:800px){
  body.exercise-focus .app-main,
  body.exercise-focus #studentWorkView,
  body.exercise-focus #studentWorkView>.card{min-height:100dvh!important;height:100dvh!important}
  body.exercise-focus #studentPreview{height:auto!important;min-height:0!important;overflow:hidden!important}
}
