:root{color-scheme:light;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#222;background:#f5f6fb;font-size:17px}*{box-sizing:border-box}body{margin:0}main{max-width:850px;margin:auto;padding:20px}h1{color:#4c59d4;font-size:30px;margin-bottom:4px}header p,.hint{font-size:13px;color:#596174;line-height:1.6}h2{font-size:19px}button,input,select{font:inherit;padding:11px;border-radius:10px;border:1px solid #d6d9e3;max-width:100%}input{width:100%;margin:7px 0}button{background:#4c59d4;color:white;cursor:pointer;min-height:44px}button.secondary{background:#edf0fd;color:#3949b5}button:disabled{opacity:.5;cursor:default}.controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:14px 0}.controls input{width:auto;flex:1;min-width:100px}.card{background:white;border-radius:16px;padding:18px;margin:15px 0;box-shadow:0 3px 16px #29357408}.item{display:grid;grid-template-columns:1fr auto;gap:5px 14px;border-bottom:1px solid #eee;padding:15px 0}.en{grid-column:1;grid-row:1;font-weight:550;line-height:1.55;overflow-wrap:anywhere}.zh{grid-column:1;grid-row:2;color:#2d62c7;line-height:1.5;overflow-wrap:anywhere}.time{grid-column:2;grid-row:1;font-variant-numeric:tabular-nums;white-space:nowrap}.badge{grid-column:1;font-size:12px;color:#737d90}.temporary .en{color:#555f72}.notice{color:#985400;font-size:14px;line-height:1.5;min-height:0}.notice:empty{display:none}#stream{height:50vh;min-height:230px;overflow-y:auto;overscroll-behavior:contain;scroll-behavior:auto}.list-row{display:flex;gap:10px;align-items:center;border-bottom:1px solid #eee;padding:10px 0}.list-row span{flex:1;overflow-wrap:anywhere}.list-row button{font-size:14px}summary{cursor:pointer;font-weight:600}label{font-size:14px;color:#4e5667}[hidden]{display:none!important}:focus-visible{outline:3px solid #9eaaff;outline-offset:2px}@media(max-width:500px){main{padding:12px}.card{padding:14px}.controls button{flex:1}.time{font-size:12px}.item{gap:5px 9px}}
textarea{font:inherit;width:100%;padding:10px;border:1px solid #d6d9e3;border-radius:10px;resize:vertical;margin:7px 0}details>label{display:block;margin-top:14px}meter{width:170px;height:20px;vertical-align:middle}.audio-monitor{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.controls label{display:flex;gap:6px;align-items:center;white-space:nowrap}.controls input[type=checkbox]{width:18px;min-width:18px;height:18px;margin:0;flex:0}.item{grid-template-columns:1fr auto auto}.time{grid-column:2}.star{grid-column:3;grid-row:1;padding:5px 8px;min-height:36px;background:transparent;color:#8b6500;border-color:#eee;font-size:21px}.marked{border-left:3px solid #e9bc4c;padding-left:10px}.terms-note{grid-column:1;font-size:12px;color:#48633e}.font-large .en,.font-large .zh{font-size:21px}.font-huge .en,.font-huge .zh{font-size:25px}mark{background:#fff0ad;color:inherit;border-radius:3px}.focus header,.focus #classroomSettings,.focus #usageSection,.focus #historySection,.focus #scheduleDetails,.focus #diagnosticsSection,.focus .privacy,.focus .local-tests{display:none}.focus main{max-width:none;height:100vh;height:100dvh;display:flex;flex-direction:column;padding:10px}.focus .card{margin:5px 0;padding:12px}.focus #captionSection{flex:1;display:flex;flex-direction:column;min-height:0}.focus #stream{flex:1;height:auto;min-height:0}#captionCount{margin:0 0 7px}.controls select{max-width:100%}#performance{font-variant-numeric:tabular-nums}#microphone{max-width:280px}body:fullscreen{background:#f5f6fb}@media(max-width:500px){.item{grid-template-columns:1fr auto}.star{grid-column:2;grid-row:2}.time{grid-column:2}.controls label{font-size:13px}#microphone{width:100%;max-width:none}}

/* Reading layout: subtitles are the main workspace; settings are folded. */
main{max-width:1480px;padding:18px 28px 32px}
header{display:flex;align-items:baseline;gap:18px;margin:0 0 12px}
header h1{font-size:26px;margin:0}header p{margin:0}
.card{margin:12px 0}.classroom-control{padding:14px 20px}
.classroom-bar{display:flex;align-items:end;gap:24px;flex-wrap:wrap}
.course-field{flex:1;min-width:260px;max-width:540px}.course-field label{font-size:12px}
.course-field input{margin:5px 0 0;padding:10px 12px}
.class-actions{margin:0;gap:8px}.class-actions button{padding:10px 18px}
.control-status{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-top:10px}
#status{margin:0;font-size:14px}.audio-monitor{gap:8px}.audio-monitor label{font-size:12px}
.audio-monitor meter{width:110px;height:14px}#engineMode{margin:5px 0 0;font-size:12px}
#setupDetails{margin-top:8px}#setupDetails>summary{font-size:12px;color:#697286;font-weight:500}
#captionSection{display:flex;flex-direction:column;height:calc(100dvh - 230px);min-height:480px;padding:20px 26px}
.reader-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}
.reader-heading h2{font-size:17px;margin:0;font-weight:650}.reader-heading #captionCount{margin:0;font-size:12px}
#readingControls{margin:12px 0 16px;gap:8px}#readingControls select,#readingControls button{padding:8px 11px;font-size:14px;min-height:38px}
#readingControls label{font-size:13px}#captionSearch{margin:0;padding:9px 12px;font-size:14px;flex:1;min-width:160px}
#stream{flex:1;height:auto;min-height:0;scrollbar-gutter:stable;padding:0 12px 24px 0}
.item{grid-template-columns:minmax(0,1fr) 46px 30px;gap:5px 12px;border-bottom:0;padding:14px 0 20px;margin:0;align-items:start}
.item:first-child{padding-top:4px}.en{font-size:20px;font-weight:450;line-height:1.8;color:#283043}
.zh{font-size:20px;line-height:1.8;color:#2559ae;min-height:1.8em}
.temporary .en{color:#394357}.time{font-size:11px;line-height:2;color:#8991a1;font-weight:400}
.star{padding:0;min-height:28px;border:0;font-size:19px;color:#acb3c0;line-height:1.6}.marked .star{color:#9c7200}
.badge,.terms-note{line-height:1.6;font-size:11px;color:#8790a0}.terms-note:empty{display:none}
.item:not(.temporary):not(.updating):not(.interrupted):not(.demo) .badge{display:none}
.updating .badge{color:#7b6b43}.marked{border-left:2px solid #e9bc4c;padding-left:12px}
.font-large .en,.font-large .zh{font-size:23px}.font-huge .en,.font-huge .zh{font-size:27px}
#usageSection>summary,#diagnosticsSection>summary,#scheduleDetails>summary{font-size:14px;color:#596174}
.focus #setupDetails,.focus .course-field,.focus #engineMode{display:none}
.focus .classroom-control{padding:8px 12px}.focus .control-status{margin-top:6px}
.focus #captionSection{height:auto;min-height:0;padding:16px 24px}.focus #stream{min-height:0}
@media(max-width:800px){main{padding:14px 16px 24px}.classroom-bar{gap:10px}.course-field{max-width:none;min-width:200px}.class-actions button{padding:9px 12px}#captionSection{padding:18px;min-height:480px}.control-status{gap:8px}.item{grid-template-columns:minmax(0,1fr) 40px 26px;gap:5px 8px}}
@media(max-width:500px){main{padding:12px 10px 20px}header{gap:10px}header h1{font-size:22px}header p{font-size:11px}.classroom-control{padding:12px}.course-field{flex-basis:100%}.class-actions{width:100%}.class-actions button{font-size:13px;padding:9px 8px}.control-status{align-items:start}#engineMode{font-size:11px}#captionSection{height:72dvh;min-height:420px;padding:16px 14px}.reader-heading h2{font-size:16px}#readingControls{gap:7px;margin:10px 0 14px}#readingControls select,#readingControls button{font-size:12px;padding:7px 9px}#readingControls label{font-size:12px}#captionSearch{order:5;flex-basis:100%;width:100%}.item{grid-template-columns:minmax(0,1fr) 34px 22px;gap:4px 6px;padding-bottom:20px}.star{grid-column:3;grid-row:1;font-size:17px}.time{grid-column:2;grid-row:1;font-size:10px}.en,.zh{font-size:18px;line-height:1.85}.font-large .en,.font-large .zh{font-size:21px}.font-huge .en,.font-huge .zh{font-size:24px}#stream{padding-right:4px}}

:root{font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif}
#readingControls button{flex:0 0 auto;white-space:nowrap}
@media(max-width:500px){#readingControls label:last-of-type{order:6}#captionSearch{order:5;flex:1;flex-basis:0;min-width:130px;width:auto}.item{grid-template-columns:minmax(0,1fr) auto}.en{grid-column:1/-1;grid-row:2}.zh{grid-column:1/-1;grid-row:3}.time{grid-column:1;grid-row:1}.star{grid-column:2;grid-row:1}.badge{grid-column:1/-1;grid-row:4}.terms-note{grid-column:1/-1;grid-row:5}}

.en{font-family:Arial,"Microsoft YaHei",sans-serif}.zh{font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",Arial,sans-serif}

/* Phase 1: stable Chinese, a fixed "current sentence" panel, steadier scrolling. */
.zh-tail{opacity:.62}
.zh-stable,.zh-tail{transition:opacity .25s}
.temporary .zh{min-height:3.6em}
#captionSection{position:relative}
/* One sentence, English above Chinese. Both lines have a fixed height, so a longer or shorter
   sentence never moves the page, and changes fade instead of snapping. */
.live-panel{display:none;flex:0 0 auto;margin:0 0 12px;padding:10px 16px;border-radius:12px;background:#f1f4ff;border:1px solid #dbe2ff;overflow:hidden}
.view-live .live-panel{display:block}
.live-en{font-family:Arial,"Microsoft YaHei",sans-serif;font-size:20px;line-height:1.5;color:#1f2740;font-weight:500;overflow-wrap:anywhere;height:3em;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden}
.live-zh{font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",Arial,sans-serif;font-size:22px;line-height:1.5;color:#1f4fb0;margin-top:6px;overflow-wrap:anywhere;height:3em;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden;transition:opacity .45s ease}
/* The panel never changes size, whatever the sentence: two lines of English and two of Chinese, and a longer text is cut at the TOP so that the newest words stay
   in view. A panel that grew and shrank with every sentence moved everything below it (the list, the AI box). */
.live-zh.rough{opacity:.78}
.live-en:empty::before{content:'当前这一句会显示在这里';color:#9aa3b8;font-size:14px;font-weight:400}
.live-panel.switching .live-en,.live-panel.switching .live-zh{animation:live-fade .22s ease-out}
@keyframes live-fade{from{opacity:.25}to{opacity:1}}
.view-live #stream .item{padding:10px 0 14px}
.view-live #stream .en,.view-live #stream .zh{font-size:17px;line-height:1.7}
.font-large .live-en{font-size:24px}.font-large .live-zh{font-size:26px}
.font-huge .live-en{font-size:29px}.font-huge .live-zh{font-size:31px}
.to-latest{position:absolute;right:26px;bottom:22px;box-shadow:0 3px 14px #29357433;z-index:2}
.focus .live-panel{padding:14px 20px}
/* Courses: the picker on the subtitle page and the "我的课程" page */
.course-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:5px}
.course-row select{flex:1;min-width:170px;max-width:340px}
.course-link{font-size:14px;color:#3949b5;text-decoration:none;white-space:nowrap}.course-link:hover{text-decoration:underline}
.course-suggest{margin:8px 0 0;padding:8px 12px;border-radius:10px;background:#fff7e0;border:1px solid #f0dca0;font-size:14px;color:#5b4a10;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.course-suggest button{padding:6px 12px;min-height:36px}
.course-manager{margin-top:10px;padding:10px 12px;border:1px solid #e5e8f2;border-radius:12px;background:#fafbff}
.course-manager .list-row input{margin:0;flex:1;min-width:0}
.history-filter select{flex:0 1 200px;min-width:120px}.history-filter input{flex:1;min-width:140px;margin:0}
.courses-page main{max-width:1366px}
.courses-page header{display:flex;align-items:baseline;justify-content:space-between;gap:16px}
.week-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:10px 0}
.day{border:1px solid #e5e8f2;border-radius:10px;padding:8px;min-height:96px;background:#fff}
.day.today{border-color:#4c59d4;background:#f4f6ff}
.day h3{margin:0 0 6px;font-size:14px;color:#3949b5}.day p.hint{margin:4px 0}
.slot{display:flex;justify-content:space-between;align-items:flex-start;gap:4px;font-size:13px;line-height:1.5;margin:4px 0;overflow-wrap:anywhere}
.slot-remove{min-height:26px;padding:0 8px;font-size:14px;flex:0 0 auto}
.entry-form select,.entry-form input{margin:0}
.course-row-card{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 0;border-bottom:1px solid #eee}
.course-row-card input{margin:0;flex:1 1 220px;min-width:0}
.term-heading{font-size:15px;margin:14px 0 4px;color:#3949b5}
@media(max-width:800px){.week-grid{grid-template-columns:1fr;gap:6px}.day{min-height:0}.day.empty{display:flex;align-items:baseline;gap:12px;padding:6px 10px}.day.empty h3,.day.empty p.hint{margin:0}}
/* Post-class summary */
#summarySection .reader-heading{margin-bottom:6px}#summarySection .controls{margin:8px 0}
#summaryProgress{width:100%;height:8px;margin:2px 0 8px}
.summary-text{line-height:1.8;font-size:16px;color:#283043;overflow-wrap:anywhere}
.summary-text:empty{display:none}
.summary-text h3{font-size:15px;margin:14px 0 4px;color:#3949b5}.summary-text h3:first-child{margin-top:0}
.summary-text p{margin:4px 0}.summary-text ul{margin:4px 0;padding-left:1.3em}.summary-text li{margin:3px 0}
.view-live #summarySection{display:none}
/* Phones: keep clear of the notch and home bar; 16px fields stop iOS zooming the page on focus. */
body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.mobile-tip{margin:8px 0 0}.audio-monitor #wakeStatus{white-space:nowrap}
@media(max-width:500px){input,select,textarea{font-size:16px!important}}
/* On a phone, a running class is all about the captions: fold away everything else. */
@media(max-width:500px){
.view-live header,.view-live .mobile-tip,.view-live .course-field,.view-live #engineMode,.view-live #setupDetails,.view-live .reader-heading,.view-live #captionSearch,.view-live #readingControls label:last-of-type,.view-live #fullscreen,.view-live #usageSection,.view-live #diagnosticsSection,.view-live #historySection,.view-live #scheduleDetails{display:none}
.view-live main{padding-top:8px}
.view-live .classroom-control{padding:10px 12px}
.view-live #captionSection{height:calc(100dvh - 150px);min-height:420px;padding:12px}
.view-live #readingControls{margin:0 0 10px}
.view-live .live-panel{padding:8px 12px}}
@media(max-width:500px){.live-panel{padding:8px 12px}.live-en{font-size:17px}.live-zh{font-size:19px;margin-top:4px}.font-large .live-en{font-size:20px}.font-large .live-zh{font-size:22px}.font-huge .live-en{font-size:23px}.font-huge .live-zh{font-size:25px}.view-live #stream .en,.view-live #stream .zh{font-size:16px}.to-latest{right:14px;bottom:14px}}

/* Section notes */
#miniSection summary{cursor:pointer;font-weight:600}
.mini-list{margin-top:.5rem}
.mini-row{margin:.35rem 0;line-height:1.5}
.mini-time{display:inline-block;min-width:3.2em;color:var(--muted,#6b7280);font-variant-numeric:tabular-nums;font-size:.9em}
label.check{display:flex;gap:.5rem;align-items:flex-start;margin:.5rem 0}

/* Schedule: end time and note */
.slot{flex-wrap:wrap}
.slot-time{font-variant-numeric:tabular-nums;color:var(--muted,#6b7280)}
.slot-note{flex-basis:100%;text-align:left;background:none;border:0;padding:.1rem 0;font-size:.85em;color:var(--muted,#6b7280);cursor:pointer}
.slot-note.empty{opacity:.6}
.time-field{display:inline-flex;align-items:center;gap:.35rem;font-size:.9em}
.slot{align-items:flex-start;gap:.25rem}
.slot-label{flex:1 1 0;min-width:0;overflow-wrap:anywhere}
.slot-time{display:block}
.slot-remove{flex:0 0 auto}
.slot-label{overflow-wrap:break-word}

/* During a class (any screen): one slim bar on top; the subtitles get the rest of the screen. */
.tools-toggle{display:none}
@media(max-width:4000px){
body.in-class main{display:flex;flex-direction:column;height:100dvh;padding:6px 8px 6px;overflow:hidden}
body.in-class .classroom-control{flex:0 0 auto;margin:0 0 6px;padding:6px 10px;display:grid;grid-template-columns:minmax(0,1fr) auto auto auto auto;align-items:center;gap:6px}
body.in-class .classroom-bar,body.in-class .class-actions,body.in-class .control-status{display:contents}
body.in-class .course-field,body.in-class #start,body.in-class #export,body.in-class #loginForm,body.in-class #mobileTip,body.in-class #engineMode,body.in-class #setupDetails,body.in-class header{display:none}
body.in-class #status{grid-column:1;grid-row:1;margin:0;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.in-class .audio-monitor{grid-column:2;grid-row:1;flex-wrap:nowrap}
body.in-class .audio-monitor label,body.in-class #micStatus,body.in-class #wakeStatus{display:none}
body.in-class .audio-monitor meter{width:52px;height:10px}
body.in-class .tools-toggle{display:block;grid-column:3;grid-row:1;padding:6px 12px;min-height:36px;font-size:13px}
body.in-class #listenPause{grid-column:4;grid-row:1;padding:6px 10px;min-height:36px;font-size:13px}
body.in-class #stop{grid-column:5;grid-row:1;padding:6px 12px;min-height:36px;font-size:13px}
body.in-class #listenRange{display:none}                                  /* 收音范围 sits under the 显示 button during a class, so the top bar stays one line */
body.in-class.show-tools #listenRange{display:block;grid-column:1/-1;grid-row:2;min-height:36px}
body.in-class #resume{grid-column:1/-1;grid-row:2}
body.in-class #notice{grid-column:1/-1;grid-row:3;margin:0;font-size:12px;line-height:1.4}
body.in-class #notice:empty{display:none}
body.in-class #readingControls{display:none;margin:0 0 6px}
body.in-class.show-tools #readingControls{display:flex}
body.in-class #captionSection{display:flex;flex-direction:column;flex:1 1 auto;height:auto;min-height:0;margin:0;padding:8px 10px}
body.in-class #stream{flex:1 1 auto;min-height:0;padding-bottom:12px}
body.in-class .live-panel{margin:0 0 6px;padding:6px 10px}
body.in-class .live-en,body.in-class .live-zh{line-height:1.3;height:2.6em}
body.in-class .live-zh{margin-top:3px}
body.in-class.view-live #stream .item{padding:8px 0 10px}
body.in-class section.card:not(#captionSection):not(.classroom-control){display:none}
}


/* Small tools: proofreading, to-do list, vocabulary */
.tool-block{margin-top:18px;padding-top:14px;border-top:1px solid #e6e8f2}
.tool-block h3{margin:0;font-size:16px}
.proofread-list,.todo-list,.vocab-list{display:grid;gap:6px;margin-top:8px}
.proofread-row{display:flex;gap:8px;align-items:flex-start;font-size:14px;line-height:1.5}
.proofread-row input{width:18px;min-width:18px;height:18px;margin:3px 0 0}
.proofread-row del{color:#b3261e;text-decoration-thickness:1px}
.proofread-row ins{color:#1b6e3a;text-decoration:none;font-weight:600}
.vocab-row{position:relative;padding:8px 36px 8px 0;border-bottom:1px solid #eef0f7}
.vocab-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.vocab-head strong{font-size:17px}.vocab-gloss{color:#1f4fb0}
.vocab-row .slot-remove{position:absolute;right:0;top:6px}
body.in-class #todoLine{display:none}
.todo-line{margin:4px 0 0}

body.in-class .onboarding{display:none}
.onboarding ol{margin:.4rem 0 .6rem 1.2rem;padding:0;line-height:1.7}
.summary-text h3.summary-part{margin-top:1.4rem;padding-top:.8rem;border-top:1px solid #e6e8f2;color:#3949b5}
.summary-text h4{margin:.8rem 0 .2rem;font-size:14px;color:#596174}

/* Live notes */
.live-notes{flex:0 0 auto;margin:0 0 10px;padding:10px 14px;border:1px solid #dbe2ff;border-radius:12px;background:#fafbff;max-height:42vh;overflow:auto}
.live-notes-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-bottom:6px}
.live-note{margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid #e9ecf8}
.live-note:last-child{border-bottom:0}
.live-note h4{margin:0 0 4px;font-size:13px;color:#596174}
.live-note-topic{margin:0 0 4px;font-weight:600}
.live-note ul{margin:.2rem 0 .4rem 1.1rem;padding:0;font-size:14px;line-height:1.55}
.live-note ul.stress li{color:#8a4b00}
.live-note-label{margin:.3rem 0 0;font-size:12px;color:#8a4b00}
@media(max-width:4000px){
body.in-class .classroom-control{grid-template-columns:minmax(0,1fr) auto auto auto auto}
body.in-class #stop{grid-column:5}
body.in-class .live-notes{max-height:38dvh;margin:0 0 6px;padding:8px 10px}
}
.summary-nav{display:flex;flex-wrap:wrap;gap:6px;margin:.4rem 0 .8rem}
.summary-nav button{min-height:34px;padding:4px 10px;font-size:13px;text-align:left}

.quiz-item{border-bottom:1px solid var(--line,#ddd);padding:6px 0}
.quiz-item summary{cursor:pointer;font-weight:500}
.quiz-item p{margin:6px 0 2px;color:var(--muted,#555)}


/* Left sidebar: course, pages and tools; collapses to a column of icons, and is a drawer on a phone. */
.shell{display:flex;align-items:flex-start;min-height:100vh}
.shell>main{flex:1 1 auto;min-width:0}
#sidebar{flex:0 0 232px;width:232px;position:sticky;top:0;height:100vh;height:100dvh;overflow-y:auto;overflow-x:hidden;background:#fff;border-right:1px solid #e6e8f2;padding:12px 10px;transition:width .2s,flex-basis .2s}
.side-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.side-toggle{min-height:38px;padding:4px 12px;font-size:18px;line-height:1}
.side-brand{font-weight:650;color:#4c59d4;white-space:nowrap}
.side-group{font-size:11px;color:#8790a0;margin:14px 8px 4px;letter-spacing:.04em}
.side-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:transparent;color:#3a4255;border:0;border-radius:8px;padding:8px 10px;min-height:38px;font-size:14px;text-decoration:none;cursor:pointer}
.side-item:hover{background:#f1f3fb}
.side-item .ico{flex:0 0 22px;text-align:center;font-size:16px}
.side-item .lbl{white-space:nowrap}
.side-backdrop{display:none}
.shell.collapsed #sidebar{flex-basis:62px;width:62px;padding:12px 8px}
.shell.collapsed .side-brand,.shell.collapsed .side-group,.shell.collapsed .lbl{display:none}
.shell.collapsed .side-item{justify-content:center;padding:8px 0}
.focus #sidebar{display:none}
@media(max-width:800px){
#sidebar{position:fixed;left:0;top:0;z-index:30;transform:translateX(-105%);transition:transform .2s;width:260px;flex-basis:260px;box-shadow:4px 0 24px #0003}
.shell.collapsed #sidebar{width:260px;flex-basis:260px;padding:12px 10px}
.shell.collapsed .side-brand,.shell.collapsed .side-group,.shell.collapsed .lbl{display:revert}
.shell.collapsed .side-item{justify-content:flex-start;padding:8px 10px}
body.side-open #sidebar{transform:none}
body.side-open .side-backdrop{display:block;position:fixed;inset:0;background:#0006;z-index:25}
body.in-class #sidebar{display:none}
}
.cards-box{margin:10px 0;padding:14px;border:1px solid #e6e8f2;border-radius:12px;background:#fafbff}
.card-face{min-height:110px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:6px}
.card-word{font-size:28px}
.card-gloss{font-size:20px;color:#1f4fb0;margin:4px 0 0}


.selection-bar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom));z-index:20;max-width:min(560px,calc(100vw - 24px));width:max-content;padding:10px 12px;border-radius:14px;background:#1f2740;color:#fff;box-shadow:0 8px 28px #0004}
.selection-bar[hidden]{display:none}
.selection-actions{display:flex;gap:8px}
.selection-actions button{min-height:38px;padding:6px 14px;background:#fff2;color:#fff;border:0}
.selection-answer{margin:8px 0 0;font-size:14px;line-height:1.6;max-height:34vh;overflow:auto;white-space:pre-line}
.selection-answer:empty{display:none}
body.in-class .selection-bar{display:none}


.history-hits{margin:-4px 0 10px 12px;display:grid;gap:4px}
.history-hit{text-align:left;background:#f4f6ff;color:#283043;border:0;border-radius:8px;padding:6px 10px;min-height:32px;font-size:13px;overflow-wrap:anywhere}
.history-hit:hover{background:#e9edff}
.know-topic{border-top:1px solid #e4e8f2;padding:8px 0}
.know-topic h3{margin:0 0 4px;font-size:16px}
.know-topic ul{margin:4px 0 4px 18px;padding:0}
.know-topic li{margin:4px 0;line-height:1.55}
.know-badge{display:inline-block;font-size:11px;background:#dfe5ff;color:#3a4a9a;border-radius:6px;padding:1px 6px;margin-left:4px;white-space:nowrap}
.know-badge.unknown{background:#f3e3e3;color:#8a3a3a}
.after-class{display:flex;flex-wrap:wrap;gap:8px;align-items:center;background:#eef7ee;border:1px solid #bcdcbc;border-radius:10px;padding:8px 12px;margin:8px 0}
.after-class span{flex:1 1 180px}
.after-class button{min-height:40px}
.deck-overview{white-space:pre-wrap;background:#f4f6ff;border-radius:10px;padding:12px 14px;margin:10px 0;line-height:1.6}
.deck-slide{border-top:1px solid #e4e8f2;padding:8px 0}
.deck-slide h3{margin:0 0 4px;font-size:15px}
.deck-slide ul{margin:4px 0 4px 18px;padding:0}
.deck-zh{white-space:pre-wrap;border-left:3px solid #8a96c8;padding:4px 10px;margin:6px 0;color:#283043;background:#f8f9fd}
.auto-fixed{text-decoration:underline dotted;text-decoration-color:#8a96c8;text-underline-offset:3px;cursor:help}
.hit-kind{display:inline-block;font-size:11px;background:#dfe5ff;color:#3a4a9a;border-radius:6px;padding:1px 6px}
.history-hit mark{background:#ffe88a;color:inherit;border-radius:3px}


.fix-memory{display:flex;flex-wrap:wrap;gap:6px}
.fix-chip{display:inline-flex;align-items:center;gap:4px;background:#f1f4ff;border-radius:8px;padding:2px 4px 2px 10px;font-size:14px}
.fix-chip button{min-height:26px;padding:0 8px;font-size:14px}


/* The new course-page sections: buttons keep their words on one line and wrap to the next row instead of being squeezed (phone width) */
#deckSection .controls,#knowledgeSection .controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#deckSection .controls button,#knowledgeSection .controls button{flex:0 0 auto;white-space:nowrap}
#deckSection .controls select,#knowledgeSection .controls select{flex:1 1 180px;min-width:0}
@media (max-width:560px){#deckView .controls button{flex:1 1 calc(50% - 8px)}}#deckSection .controls input[type=file]{flex:1 1 100%;min-width:0;max-width:100%}

/* Live notes beside the subtitles on a wide screen; the bar between them can be dragged (see app.js) */
.notes-split{display:none}
@media (min-width:900px){
  .caption-body.side-notes{display:grid;grid-template-columns:minmax(0,1fr) 10px minmax(0,var(--notes-w,36%));grid-template-rows:minmax(230px,50vh);gap:0}
  .caption-body.side-notes #stream{grid-column:1;height:auto;min-height:0}
  .caption-body.side-notes .notes-split{display:block;grid-column:2;cursor:col-resize;touch-action:none;position:relative;background:transparent}
  .caption-body.side-notes .notes-split::before{content:"";position:absolute;top:8px;bottom:8px;left:4px;width:2px;border-radius:2px;background:#cfd6f3}
  .caption-body.side-notes .notes-split:hover::before,.caption-body.side-notes .notes-split:focus-visible::before{background:#5868e0;width:3px;left:3.5px}
  .caption-body.side-notes #liveNotesPanel{grid-column:3;max-height:none;margin:0;min-height:0;overflow:auto}
}.caption-body{display:flex;flex-direction:column;min-width:0}
.caption-body #liveNotesPanel{order:-1}
#captionBody,body.in-class #captionBody{flex:1 1 auto;min-height:0}@media (min-width:900px){.caption-body.side-notes #stream,.caption-body.side-notes .notes-split,.caption-body.side-notes #liveNotesPanel{grid-row:1;order:0}}
.vocab-meaning{font-size:16px;font-weight:600;color:#ffe8a3}
.vocab-meaning:empty{display:none}.item.from-zh .en{font-style:italic;color:#4a5568}.item.from-zh{border-left:3px solid #9aa5e6;padding-left:8px}.item.other-voice{border-left:3px solid #e0b27a;padding-left:8px}
.chat-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.chat-chip{padding:6px 10px;font-size:13px}
.chat-log{display:flex;flex-direction:column;gap:6px;max-height:320px;overflow:auto;margin:8px 0}.chat-q{align-self:flex-end;background:#eef1ff;border-radius:10px;padding:6px 10px;max-width:92%}.chat-a{align-self:flex-start;background:#f6f7fb;border-radius:10px;padding:6px 10px;max-width:92%;white-space:pre-wrap}
.today-list{margin:0;padding-left:20px;line-height:1.9}.today-list a{color:inherit}

.button-link{display:inline-block;padding:8px 12px;border:1px solid #c9d0f5;border-radius:8px;background:#eef1ff;color:#3949b5;text-decoration:none}

.member-qr{text-align:center;margin:8px 0}.member-qr img{background:#fff;padding:6px;border:1px solid #e5e8f2;border-radius:8px}
.hw-row .overdue{color:#b3261e}
body.in-class #settingsToggle{display:none}      /* the settings fold away when a class starts, and the button was stretched into a whole extra row under the slim bar */

.item.speaker-0{border-left:3px solid #7aa7e0;padding-left:8px}.item.speaker-1{border-left:3px solid #e0a07a;padding-left:8px}.item.speaker-2{border-left:3px solid #8fcf9a;padding-left:8px}.item.speaker-3{border-left:3px solid #c59be0;padding-left:8px}
