.ce-backdrop { padding: 10px; }
.modal--course-editor { width: min(1480px, 98vw); height: 96dvh; max-height: 96dvh; }
.modal--course-editor > header { padding: 14px 22px; }
.modal--course-editor > header h2 { font-size: 21px; }
.modal--course-editor .modal-body { padding: 0; overflow: hidden; }
.ce-shell { color: var(--ink); background: var(--paper); display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ce-toolbar { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ce-toolbar small, .ce-caption { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ce-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ce-shell button, .ce-preview button, .ce-history button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; line-height: 1.4; }
.ce-shell button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.ce-layout { display: grid; grid-template-columns: 160px minmax(300px, 1fr) 310px; flex: 1; min-height: 0; }
.ce-pages { overflow: auto; padding: 12px; border-right: 1px solid var(--line); background: var(--ivory); }
.ce-pages .ce-page { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: left; margin-bottom: 12px; background: var(--paper); padding: 8px; }
.ce-page.active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.ce-page b { font-size: 12px; overflow-wrap: anywhere; }
.ce-page small { font-size: 11px; color: var(--muted); }
.ce-thumb { display: grid; place-items: center; min-height: 60px; width: 100%; background: #fff; color: #687789; aspect-ratio: 16 / 10; overflow: hidden; font-size: 11px; }
.ce-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ce-main { min-width: 0; overflow: auto; background: var(--ivory); padding: 12px 18px; }
.ce-page-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.ce-sheet { display: grid; place-items: center; min-height: 160px; background: #fff; color: #687789; box-shadow: 0 4px 18px #0001; }
.ce-sheet img { width: 100%; height: auto; object-fit: contain; }
.ce-tools { overflow: auto; padding: 0 16px 20px; border-left: 1px solid var(--line); }
.ce-tools section { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.ce-tools h3, .ce-tools p { margin: 0; }
.ce-tools h3 { font-size: 16px; }
.ce-tools label { display: grid; gap: 7px; font-size: 13px; }
.ce-tools input { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.ce-tools form { display: grid; gap: 8px; }
.ce-tools audio, .ce-preview audio { width: 100%; }
.ce-warning { color: var(--warning); border-left: 3px solid var(--warning); padding: 8px 10px; font-size: 13px; line-height: 1.7; }
.ce-segments article, .ce-history article { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin-bottom: 10px; overflow-wrap: anywhere; }
.ce-segments small, .ce-history small, .ce-summary p { color: var(--muted); font-size: 13px; }
.ce-preview .ce-sheet { max-width: 950px; margin: 0 auto 14px; }
.ce-preview .ce-sheet img { max-height: 65dvh; }
.ce-preview .ce-actions { margin: 12px 0; }
@media(max-width: 1000px) {
  .ce-layout { grid-template-columns: 125px minmax(230px,1fr) 260px; }
  .ce-toolbar { align-items: flex-start; }
  .ce-toolbar .ce-actions { justify-content: flex-end; }
}
@media(max-width: 760px) {
  .modal--course-editor { width: 100%; height: 98dvh; max-height: 98dvh; }
  .modal--course-editor > header { padding: 10px 12px; }
  .modal--course-editor > header h2 { font-size: 16px; }
  .ce-toolbar { display: grid; padding: 10px 12px; }
  .ce-toolbar small { font-size: 11px; }
  .ce-toolbar .ce-actions { justify-content: flex-start; gap: 6px; }
  .ce-toolbar button { font-size: 12px; padding: 7px 9px; }
  .ce-layout { display: block; overflow: auto; min-height: 0; }
  .ce-pages { display: flex; gap: 12px; overflow-x: auto; border-right: 0; padding: 12px; }
  .ce-pages .ce-page { flex: 0 0 104px; margin: 0; }
  .ce-page b { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .ce-main { overflow: visible; padding: 12px; }
  .ce-sheet img { max-height: 42dvh; }
  .ce-tools { overflow: visible; border: 0; }
}

/* v74: the slide stays visible while recording in the same editor. */
.ce-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ce-page-nav, .ce-main > .ce-caption { flex-shrink: 0; }
.ce-page-stage { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.ce-pages { overscroll-behavior: contain; }
.ce-recorder[hidden] { display: none; }
.ce-recorder { flex-shrink: 0; display: grid; gap: 10px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper); }
.ce-record-heading, .ce-record-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; }
.ce-record-heading { font-size: 13px; }
.ce-record-heading [data-clock] { color: var(--teal); font-variant-numeric: tabular-nums; }
.ce-record-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.ce-record-title span { flex-shrink: 0; }
.ce-record-title input { min-width: 0; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 16px; }
.ce-record-controls { justify-content: flex-start; }
.ce-record-controls button { min-height: 40px; }
.ce-recorder audio { width: 100%; height: 34px; }
.ce-recorder p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ce-is-recording .ce-toolbar, .ce-is-recording .ce-tools, .ce-is-recording .ce-main > .ce-caption { display: none; }
.ce-is-recording .ce-layout { grid-template-columns: 140px minmax(0, 1fr); overflow: hidden; }
.ce-is-recording .ce-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: auto minmax(0, 1fr); gap: 12px; min-width: 0; min-height: 0; }
.ce-is-recording .ce-page-nav { grid-column: 1 / -1; margin: 0; }
.ce-is-recording .ce-page-stage { display: flex; align-items: stretch; justify-content: center; min-height: 64px; overflow: auto; }
.ce-is-recording .ce-sheet { width: 100%; height: 100%; min-height: 0; background: transparent; box-shadow: none; }
.ce-is-recording .ce-sheet img { width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain; }
.ce-is-recording .ce-recorder { align-self: start; max-height: 100%; overflow: auto; margin-top: 0; }
.ce-is-recording .ce-record-title { display: grid; gap: 6px; }
.ce-is-recording .ce-record-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 761px) and (max-width: 1100px) {
  .ce-is-recording .ce-layout { grid-template-columns: minmax(0, 1fr); }
  .ce-is-recording .ce-pages { display: none; }
  .ce-is-recording .ce-main { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 760px) {
  .ce-main { overflow: visible; }
  .ce-page-stage { flex: none; overflow: visible; }
  .ce-is-recording .ce-layout { display: flex; flex-direction: column; }
  .ce-is-recording .ce-pages { display: none; }
  .ce-is-recording .ce-main { display: flex; flex: 1; padding: 10px; gap: 0; overflow: hidden; }
  .ce-is-recording .ce-page-nav { margin-bottom: 8px; }
  .ce-is-recording .ce-page-stage { flex: 1; overflow: auto; }
  .ce-is-recording .ce-recorder { align-self: stretch; max-height: 52%; margin-top: 8px; }
  .ce-is-recording .ce-record-title { display: flex; }
  .ce-recorder { padding: 10px; gap: 8px; margin-top: 8px; }
  .ce-record-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ce-record-controls button { padding: 8px; }
  .ce-record-heading { gap: 4px; font-size: 12px; }
}
@media (max-height: 540px) {
  .ce-is-recording .modal--course-editor > header { min-height: 42px; padding: 6px 12px; }
  .ce-is-recording .modal--course-editor > header .micro-label { display: none; }
  .ce-is-recording .modal--course-editor > header h2 { font-size: 15px; margin: 0; }
  .ce-is-recording .ce-main { padding: 6px 10px; }
  .ce-is-recording .ce-page-nav { margin-bottom: 6px; }
  .ce-is-recording .ce-page-nav button { padding: 6px 10px; }
  .ce-is-recording .ce-recorder { margin-top: 6px; padding: 8px 10px; gap: 6px; }
}
