:root{--video-bg:#080807;--video-surface:#111110;--video-raised:#191816;--video-line:#353025;--video-text:#f4f0e7;--video-muted:#aaa69e;--video-gold:#d2aa5c;--video-gold-light:#f2d390}
body.video-page{min-height:100dvh;background:var(--video-bg);color:var(--video-text);font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.video-page h1{letter-spacing:-.045em;font-weight:750}.video-page h2{letter-spacing:-.025em;font-weight:700}.video-page h3{letter-spacing:-.01em}
.video-page p{color:var(--video-muted)}.video-page button{border-color:var(--video-line);background:var(--video-raised);color:var(--video-text);transition:background .18s,border-color .18s,transform .18s}
.video-page button:hover{border-color:#8c7345;background:#24211a}.video-page button:focus-visible,.video-page summary:focus-visible,.video-page input:focus-visible,.video-page select:focus-visible,.video-page a:focus-visible{outline:2px solid var(--video-gold);outline-offset:3px}
.video-page .primary,.video-page #downloadChapter,.video-page .question-nav button:last-child{background:var(--video-gold);color:#16120b;border-color:var(--video-gold)}
.video-page .primary:hover,.video-page #downloadChapter:hover{background:var(--video-gold-light)}.video-page .danger{background:#291818;border-color:#71473e;color:#edbbb1}.video-page .danger:hover{background:#3a201d;border-color:#aa6858}
.video-page .topbar{background:#0c0c0b;border-bottom-color:var(--video-line)}.video-page .brand{color:var(--video-gold)}.video-page .topbar-title{color:#dbd4c6}.video-page #accountName,.video-page .back-link{color:var(--video-muted)}.video-page .back-link:hover{color:var(--video-gold-light)}
.video-page main{max-width:1320px;padding-top:6px}.video-page .studio-intro{align-items:center;margin:16px 0 24px}.video-page .intro-copy{margin:8px 0 12px;max-width:62ch;font-size:.94rem}.video-page .eyebrow{color:var(--video-gold);letter-spacing:.12em}
.device-status{display:inline-flex;align-items:center;gap:7px;color:#c8bb9e;font-size:.77rem}.device-status::before{content:"";width:6px;height:6px;background:var(--video-gold);border-radius:50%}.device-status.unsupported{color:#edbbb1}.device-status.unsupported::before{background:#ca7b64}
.video-page .studio-tabs{padding:4px;gap:3px;max-width:720px;background:#11110f;border-color:var(--video-line);border-radius:12px}.video-page .studio-tabs button{min-height:46px;background:transparent;border-color:transparent;color:var(--video-muted);border-radius:9px}.video-page .studio-tabs button[aria-selected="true"]{color:var(--video-gold-light);background:#252116;border-color:#66532f}
.video-page .status,.video-page #status{color:var(--video-muted);font-size:.86rem;margin:14px 0 20px}.video-page .panel{background:var(--video-surface);box-shadow:0 0 0 1px #2a2720,0 16px 36px #0003;border-radius:16px;padding:24px}
.video-page .section-heading p{max-width:62ch}.video-page .section-heading h2{margin-bottom:2px}.video-page .selectors{margin-bottom:0}
.video-page .filter-picker{background:#10100e;border-color:#494031;color:var(--video-text)}.video-page .filter-picker[open]{border-color:var(--video-gold)}.video-page .filter-picker>summary span{color:var(--video-muted)}.video-page .filter-picker>summary strong{color:var(--video-text)}.video-page .filter-menu{background:#151410;border-color:#5c4c31;box-shadow:0 18px 40px #0009}.video-page .filter-option{display:flex!important;min-width:0;color:var(--video-text);gap:9px;align-items:center;flex-direction:row;flex:none;font-weight:500}.video-page .filter-option:hover{background:#29251b}.video-page .filter-option input{accent-color:var(--video-gold)}.video-page .filter-actions button{background:#242016;border-color:#4c402b}.video-page .filter-empty{color:var(--video-muted)}
.health-strip{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:12px 14px;border-radius:9px;background:#1a1812;border:1px solid #3b3320;color:#d7c39d;font-size:.78rem}.health-strip strong{font-weight:600}.health-strip span{color:var(--video-muted)}.needs-attention{color:#edaaa0!important}
.video-page .overview-stat{background:#191713;border-color:#373022;border-radius:11px;padding:15px}.video-page .overview-stat strong{color:var(--video-gold-light);font-size:1.45rem;font-weight:650}.video-page .overview-stat span{color:var(--video-muted)}.video-page .overview-year,.video-page .overview-module{background:#141411;border-color:#363025}.video-page .overview-year>summary,.video-page .overview-module>summary{font-size:.88rem;font-weight:650}.video-page .overview-module{background:#10100e}.video-page .overview-subject{background:#1c1a14;color:#c6c0b4}.video-page .overview-subject.head{background:#10100e;color:#b8a787;font-size:.75rem}
.video-page .library-stats{background:#242015;color:#ead9b6;border-radius:10px;padding:13px 16px;font-size:.88rem}.video-page .saved-video-row{background:#181714;border-color:#383125;border-radius:11px;padding:14px}.video-page .saved-video-detail strong{font-size:.82rem;color:#d0b985}.video-page .saved-video-detail p{color:var(--video-text);margin:6px 0;font-weight:550}.video-page .saved-video-detail small{color:var(--video-muted);font-size:.76rem}.video-page .saved-select input{accent-color:var(--video-gold)}.video-page .saved-pagination{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:15px;font-size:.82rem;color:var(--video-muted)}.video-page #recordingList .take-row button{background:#1a1812;border-color:#3c3424;font-size:.8rem}.video-page #recordingList details>summary{color:var(--video-muted);font-size:.88rem}
.record-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;margin-top:20px}.record-outline{min-width:0;border-right:1px solid var(--video-line);padding-right:18px}.record-workspace{min-width:0}.video-page .coverage-head{margin:0 0 14px;display:flex;flex-direction:column;gap:9px;align-items:stretch}.video-page .coverage-head h3{font-size:.95rem}.video-page .coverage-head p{font-size:.78rem}.video-page .question-picker{max-height:640px;margin:0}.video-page .question-row{background:#171612;border-color:#363024;border-radius:9px;flex-wrap:wrap;gap:4px;padding:7px}.video-page .question-row.selected{background:#272214;border-color:#a48342}.video-page .question-choice{flex-basis:100%;font-size:.8rem;color:var(--video-text);padding:7px 5px}.video-page .question-choice:hover{background:#2c271b}.video-page .coverage-badge{font-size:.66rem;min-width:76px;border-radius:5px;font-weight:600}.video-page .coverage-badge.recorded{background:#273528;color:#c0d8b3}.video-page .coverage-badge.missing{background:#2e291f;color:#d8c6a0}.video-page .watch-question{margin-left:auto;background:transparent;border-color:#665331!important}.video-page .question-delete-select{width:32px;height:32px}.video-page .question-delete-select input{accent-color:var(--video-gold)}
.video-page .canvas-caption{font-size:.76rem;margin-bottom:9px}.video-page #questionCanvas{border-radius:11px;background:#ffffff;outline-color:#597e6b}.video-page .canvas-tools{gap:8px;margin:12px 0}.video-page .canvas-tools label{font-size:.75rem;color:var(--video-muted)}.video-page .canvas-tools button{min-height:38px;padding:7px 10px;font-size:.76rem}.video-page .question-nav{border-color:var(--video-line);gap:10px}.video-page .question-nav span{font-size:.73rem;color:var(--video-muted)}.video-page .question-nav button{font-size:.8rem;min-height:46px}.video-page .record-section{margin-top:16px}.video-page .record-mode{background:#1b1811;box-shadow:inset 0 0 0 1px #423720;border-radius:10px;padding:15px;align-items:flex-start}.video-page .record-mode strong{font-size:.85rem;color:#e9d6ae}.video-page .record-mode p{font-size:.76rem;max-width:50ch}.video-page .record-actions{flex-direction:column;gap:6px;min-width:210px}.video-page .record-actions button{font-size:.77rem;min-height:42px}.record-safety{font-size:.73rem;color:var(--video-muted);margin:12px 0 0}.video-page #recordIndicator{background:#252116;color:#e2c992;font-size:.78rem;border-radius:8px;font-variant-numeric:tabular-nums}.video-page #recordIndicator.live{background:#542a1f;color:#ffdbc8}.video-page .question-preview{background:#17140e;border-color:#5b492c}.video-page .question-preview strong{font-size:.86rem}.video-page .question-preview video{width:100%}.video-page .segment-row{background:#1a1813;box-shadow:inset 0 0 0 1px #3d3423;border-radius:10px}.video-page .segment-row strong{font-size:.82rem}.video-page .segment-row label{color:var(--video-muted)}.video-page input[type=email],.video-page input[type=number],.video-page select{background:#10100e;border-color:#4a3f2b;color:var(--video-text)}
.video-page .page-heading{margin-top:25px;max-width:860px}.video-page .page-heading h1{font-size:clamp(1.65rem,3vw,2.4rem)}.video-page .page-heading>p:last-child{font-size:.9rem}.chapter-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:26px;align-items:start}.chapter-layout[hidden]{display:none}.chapter-main{min-width:0}.chapter-outline{background:#11110e;border:1px solid #393023;border-radius:15px;padding:17px;min-width:0}.outline-heading h2{font-size:1rem;margin:0}.outline-heading p{font-size:.76rem;margin:6px 0 14px}.video-page .player-card{background:#14130f;box-shadow:0 0 0 1px #4a3b24,0 18px 40px #0004;padding:5px;border-radius:15px}.video-page .controls{gap:7px;margin-top:14px}.video-page .controls button{padding:9px 11px;font-size:.77rem}.video-page .question-heading{padding-top:16px;border-top:1px solid #393022}.video-page .question-heading h2{font-size:1rem;font-weight:550;line-height:1.55;overflow-wrap:anywhere}.video-page .question-list{gap:6px;max-height:68vh;overflow:auto}.video-page .question-list button{display:flex;flex-direction:column;gap:5px;align-items:flex-start;background:#191713;border-color:#373024;min-height:62px;padding:11px;font-size:.81rem;line-height:1.4}.video-page .question-list button.active{background:#302718;border-color:#b4904b;box-shadow:none}.video-page .question-list small{color:#bd9e68;font-size:.7rem}
@media(max-width:1050px){.record-layout{grid-template-columns:210px minmax(0,1fr);gap:17px}.video-page .record-mode{flex-direction:column}.video-page .record-actions{flex-direction:row;min-width:0;width:100%}.video-page .record-actions button{flex:1}.chapter-layout{grid-template-columns:minmax(0,1fr) 260px;gap:18px}}
@media(max-width:780px){.record-layout,.chapter-layout{grid-template-columns:1fr}.record-outline{border:0;padding:0}.video-page .question-picker{max-height:205px}.video-page .question-row{flex-wrap:nowrap}.video-page .question-choice{flex-basis:auto}.video-page .coverage-head{flex-direction:row;align-items:center}.video-page .studio-intro{align-items:flex-start;gap:14px}.video-page .intro-copy{font-size:.82rem}.video-page .studio-tabs{max-width:none}.video-page .question-nav{position:sticky;bottom:0;z-index:4;background:#11110ff5;padding:10px 0;box-shadow:0 -10px 24px #0005}.video-page .question-nav span{order:3;flex-basis:100%;min-width:0;text-align:left}.video-page .question-nav button{flex:1;min-height:48px}.video-page .question-list{max-height:450px}.chapter-outline{padding:14px}.video-page .question-heading{margin-bottom:0}.video-page .controls button{min-height:48px}.video-page .controls #downloadChapter{flex-basis:100%;margin-left:0}}
@media(max-width:520px){.video-page .panel{padding:16px;border-radius:12px}.video-page main{padding-right:12px;padding-left:12px}.video-page .topbar-title{font-size:.77rem}.video-page #accountName{max-width:115px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.72rem}.video-page .studio-intro{flex-wrap:wrap}.video-page .studio-intro .back-link{font-size:.76rem;margin:0}.device-status{font-size:.7rem}.video-page .studio-tabs button{font-size:.75rem;min-height:44px}.video-page .segment-row{display:flex;flex-wrap:wrap;gap:8px}.video-page .segment-row strong{flex-basis:100%}.video-page .segment-row label{flex:1;min-width:110px}.video-page .segment-row button{flex:1;min-height:44px;font-size:.74rem}.video-page .canvas-tools{gap:6px}.video-page .canvas-tools button{flex:1}.video-page .saved-pagination{justify-content:space-between;gap:5px;font-size:.73rem}.video-page .saved-pagination button{padding:8px 11px;font-size:.74rem}.health-strip{align-items:flex-start;font-size:.72rem}.video-page .record-actions{flex-direction:column}.video-page .saved-actions button{font-size:.77rem}.video-page .filter-option{min-width:0!important}}
@media(prefers-reduced-motion:reduce){.video-page *, .sirius-video-player *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.recording-preferences{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin:0 0 12px;font-size:.78rem;color:var(--video-muted)}.recording-preferences label{display:flex;align-items:center;gap:7px;cursor:pointer}.recording-preferences input{accent-color:#39745c;width:17px;height:17px}.recording-preferences .quality-label{margin-left:auto;color:#b4c9bc;font-size:.72rem}.recording-preferences small{color:#b4c9bc}.recording-chapter-choice{margin-top:16px;padding-top:16px;border-top:1px solid var(--video-line)}.recording-chapter-choice label{display:block;margin-bottom:7px;font-size:.8rem;color:var(--video-muted)}.recording-chapter-choice select{width:100%;min-height:46px;padding:10px 12px;border:1px solid var(--video-line);border-radius:8px}.recording-chapter-choice p{font-size:.78rem;margin-bottom:0}
.video-page .chapter-outline{max-height:min(540px,65dvh);display:flex;flex-direction:column;overflow:hidden}.video-page .outline-heading{flex:0 0 auto}.video-page .question-list{min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scroll-behavior:smooth;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#817257 #181712;padding-right:5px}.video-page .question-list::-webkit-scrollbar{width:7px}.video-page .question-list::-webkit-scrollbar-track{background:#181712;border-radius:8px}.video-page .question-list::-webkit-scrollbar-thumb{background:#817257;border-radius:8px}.video-page .question-list::-webkit-scrollbar-thumb:hover{background:#ac966d}
@media(max-width:780px){.video-page .chapter-outline{max-height:360px}.recording-preferences .quality-label{margin-left:0;flex-basis:100%}}

/* Keep notch/home-indicator insets outside the studio controls and canvas. */
:root {
  --video-safe-top: min(env(safe-area-inset-top, 0px), 60px);
  --video-safe-bottom: env(safe-area-inset-bottom, 0px);
  --video-safe-left: env(safe-area-inset-left, 0px);
  --video-safe-right: env(safe-area-inset-right, 0px);
  --video-page-gutter: 16px;
  --video-menu-clearance: 80px;
}
.video-page .topbar {
  padding-top: calc(14px + var(--video-safe-top));
  padding-bottom: 14px;
  padding-left: max(20px, calc((100vw - 1240px) / 2), var(--video-safe-left));
  padding-right: max(20px, calc((100vw - 1240px) / 2), var(--video-safe-right));
}
.video-page main {
  padding-left: max(var(--video-page-gutter), var(--video-safe-left));
  padding-right: max(var(--video-page-gutter), var(--video-safe-right));
  padding-bottom: calc(70px + var(--video-safe-bottom));
}
.video-page .studio-tabs { min-width: 0; }
.video-page .studio-tabs button { min-width: 0; line-height: 1.3; }
.video-page .filter-menu {
  max-width: calc(100vw - var(--video-safe-left) - var(--video-safe-right) - var(--video-menu-clearance));
}
@media (max-width: 700px) {
  .video-page .studio-tabs { top: var(--video-safe-top); }
}
@media (max-width: 780px) {
  .video-page .question-nav { padding-bottom: calc(10px + var(--video-safe-bottom)); }
}
@media (max-width: 520px) {
  :root { --video-page-gutter: 12px; --video-menu-clearance: 56px; }
}
@media (pointer: coarse), (max-width: 1100px) {
  .video-page button,
  .video-page .question-choice,
  .video-page .question-row .watch-question,
  .video-page .canvas-tools button,
  .video-page .record-actions button,
  .video-page .filter-actions button { min-height: 44px; }
  .video-page .recording-preferences label,
  .video-page .canvas-tools label { min-height: 44px; }
  .video-page .canvas-tools input[type=color] { width: 44px; height: 44px; }
  .video-page .canvas-tools input[type=range] { min-height: 44px; }
}
@media (max-width: 1100px) and (max-height: 520px) and (orientation: landscape) {
  .video-page .studio-tabs { position: static; }
  .video-page .question-nav {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #11110ff5;
    padding: 10px 0 calc(10px + var(--video-safe-bottom));
    box-shadow: 0 -10px 24px #0005;
  }
  .video-page .question-nav span { order: 3; flex-basis: 100%; min-width: 0; text-align: left; }
  .video-page .question-nav button { flex: 1; min-height: 44px; }
}

/* Record buttons live in the studio header, next to "All matching questions". */
.video-page .studio-head { flex-wrap: wrap; }
.video-page .studio-head .record-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; width: auto; gap: 8px; margin-left: auto; }
.video-page .studio-head .record-actions button { flex: 0 0 auto; width: auto; min-height: 38px; }
.video-page .studio-head .record-actions.unsupported { opacity: .7; }
@media (max-width: 520px) {
  .video-page .studio-head .record-actions { width: 100%; margin-left: 0; }
  .video-page .studio-head .record-actions button { flex: 1; }
}

/* "Matching questions" browser: slim one-line rows, not tall horizontal cards. */
body.video-page #matchingQuestionsList.question-picker { display: flex; flex-direction: column; gap: 6px; max-height: min(65vh, 680px); overflow-x: hidden; overflow-y: auto; padding: 0 2px 0 0; scroll-snap-type: none; }
body.video-page #matchingQuestionsList .question-row { flex: 0 0 auto; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 12px; min-height: 0; padding: 4px 10px; }
body.video-page #matchingQuestionsList .question-choice { flex: 1 1 0; min-width: 0; min-height: 34px; display: block; padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
body.video-page #matchingQuestionsList .question-row small { flex: 0 1 38%; min-width: 0; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.video-page #matchingQuestionsList .question-row > :not(.question-choice) { align-self: center; }
body.video-page #matchingQuestionsList .coverage-badge { flex: 0 0 auto; }
@media (max-width: 780px) {
  body.video-page #matchingQuestionsList .question-row { flex-wrap: wrap; gap: 2px 8px; padding: 6px 10px; }
  body.video-page #matchingQuestionsList .question-choice { flex: 1 1 100%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  body.video-page #matchingQuestionsList .question-row small { flex: 1 1 0; }
}

/* Light theme for the student chapter-video page. chapter-video.html loads
   boot-theme-lite.js, which mirrors the app's saved theme onto <html>; the
   studio page never sets data-theme, so it stays dark. The video frame itself
   stays dark in both themes. */
:root{--video-error:#ffaba5}
html[data-theme="light"]{color-scheme:light;--video-error:#a3261b;background:#f7f5ef;color:#15120e}
html[data-theme="light"] body.video-page{--video-bg:#f7f5ef;--video-surface:#fffefa;--video-raised:#f0ece2;--video-line:#d7cdbb;--video-text:#15120e;--video-muted:#5c5547;--video-gold:#8a6317;--video-gold-light:#6f4f10}
html[data-theme="light"] .video-page button:hover{border-color:#b88d43;background:#ece5d4}
html[data-theme="light"] .video-page .primary,html[data-theme="light"] .video-page #downloadChapter,html[data-theme="light"] .video-page .controls .primary{background:#c99b3d;border-color:#c99b3d;color:#1a1408}
html[data-theme="light"] .video-page .primary:hover,html[data-theme="light"] .video-page #downloadChapter:hover{background:#d8ae55;border-color:#d8ae55}
html[data-theme="light"] .video-page .topbar{background:#fffefa;border-bottom-color:#d7cdbb}
html[data-theme="light"] .video-page .brand{color:#8a6317}
html[data-theme="light"] .video-page .topbar-title{color:#3d372c}
html[data-theme="light"] .video-page .back-link{color:#5c5547}
html[data-theme="light"] .video-page .back-link:hover{color:#6f4f10}
html[data-theme="light"] .video-page .page-heading>p:last-child,html[data-theme="light"] .video-page #status,html[data-theme="light"] .video-page .controls span{color:#5c5547}
html[data-theme="light"] .video-page .player-card{background:#ece6d6;box-shadow:0 0 0 1px #d7cdbb,0 18px 40px #4e38101f}
html[data-theme="light"] .video-page .chapter-outline{background:#fffefa;border-color:#d7cdbb}
html[data-theme="light"] .video-page .question-heading{border-top-color:#d7cdbb}
html[data-theme="light"] .video-page .question-list button{background:#f6f2e8;border-color:#d7cdbb;color:#15120e}
html[data-theme="light"] .video-page .question-list button:hover{background:#ece5d4;border-color:#b88d43}
html[data-theme="light"] .video-page .question-list button.active{background:#f3e6c4;border-color:#b4904b;box-shadow:0 0 0 1px #b4904b55}
html[data-theme="light"] .video-page .question-list small{color:#7a5a14}
html[data-theme="light"] .video-page .question-list{scrollbar-color:#b9ac90 #ece5d4}
html[data-theme="light"] .video-page .question-list::-webkit-scrollbar-track{background:#ece5d4}
html[data-theme="light"] .video-page .question-list::-webkit-scrollbar-thumb{background:#b9ac90}
html[data-theme="light"] .video-page .question-list::-webkit-scrollbar-thumb:hover{background:#9c8d6e}
html[data-theme="light"] .video-page .controls #downloadChapter:disabled{opacity:.5}
@media(max-width:780px){html[data-theme="light"] .video-page .question-nav{background:#f7f5ef}}
