:root {
  color-scheme: light;
  --canvas: #F6F7F2;
  --paper: #FFFFFF;
  --ink: #1D322B;
  --muted: #52645D;
  --line: #D8E1D8;
  --brand: #175F50;
  --brand-soft: #E7EFE7;
  --speaker-1: #B65D35;
  --speaker-2: #197CA5;
  --speaker-3: #8256A5;
  --speaker-4: #2B7B6C;
  --question: #9A4A24;
  --question-soft: #FFF3E8;
  --question-bubble-bg: #327C5A;
  --question-bubble-compact: #28684D;
  --slide-source: #175F50;
  --teacher-source: #3E6580;
  --ai-source: #80602C;
  --danger: #A23D33;
  --placeholder: #65766F;
  --scroll-thumb: #829188;
  --avatar-bg: #DDE9DF;
  --enterprise-tier: #123D36;
  --classroom-top: #FFFFFF;
  --classroom-upper: #FBFCF9;
  --classroom-middle: #F6F9F4;
  --classroom-bottom: #FAFBF7;
  --classroom-glow-main: rgba(92, 157, 108, .095);
  --classroom-glow-edge: rgba(172, 198, 176, .14);
  --classroom-glow-low: rgba(139, 180, 146, .075);
  --classroom-dot: rgba(56, 110, 75, .15);
  --sources-bg: #EFF3EC;
  --understanding-bg: #F3F6F1;
  --field-bg: #FFFFFF;
  --source-action-bg: #F9FBF7;
  --source-action-hover: #E3EDE4;
  --source-action-border: #B8CDBD;
  --source-page-current: #E1ECE2;
  --understanding-tab-active: #E7ECE7;
  --understanding-tab-hover: #EDF1ED;
  --pdf-stage: #ECEFE8;
  --demo-highlight: #E8F1E9;
  --demo-highlight-clear: #E8F1E900;
  --player-surface: #FFFFFF;
  --player-rail: #EAEAEA;
  --player-rail-played: var(--brand);
  --player-control: #202020;
  --player-duration: #C8C8C8;
  --player-thumb-border: #AFAFAF;
  --player-menu-selected: #2862F0;
  --brand-button: #175F50;
  --brand-button-hover: #124C40;
  --brand-button-active: #0D3E34;
  --question-button: #9A4A24;
  --danger-button: #A23D33;
  --danger-button-hover: #852E27;
  --on-button: #FFFFFF;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0F0F0F;
  --paper: #202020;
  --ink: #D4D4D4;
  --muted: #9E9E9E;
  --line: #353535;
  --brand: #87C9A8;
  --brand-soft: #26352C;
  --speaker-1: #F0A37C;
  --speaker-2: #79C7EC;
  --speaker-3: #C5A0E8;
  --speaker-4: #9ADBCB;
  --question: #DB9F79;
  --question-soft: #342820;
  --question-bubble-bg: #327C5A;
  --question-bubble-compact: #28684D;
  --slide-source: #87C9A8;
  --teacher-source: #A2C3D5;
  --ai-source: #D0B482;
  --danger: #EC9A8E;
  --placeholder: #878787;
  --scroll-thumb: #5A5A5A;
  --avatar-bg: #344139;
  --enterprise-tier: #CAE3D3;
  --classroom-top: #0F0F0F;
  --classroom-upper: #0F0F0F;
  --classroom-middle: #101010;
  --classroom-bottom: #101010;
  --classroom-glow-main: rgba(64, 137, 83, .115);
  --classroom-glow-edge: rgba(100, 142, 108, .075);
  --classroom-glow-low: rgba(55, 112, 77, .07);
  --classroom-dot: rgba(144, 195, 158, .16);
  --sources-bg: #202020;
  --understanding-bg: #202020;
  --field-bg: #262626;
  --source-action-bg: #181818;
  --source-action-hover: #292929;
  --source-action-border: #454545;
  --source-page-current: #2A332D;
  --understanding-tab-active: #303530;
  --understanding-tab-hover: #292D2A;
  --pdf-stage: #292929;
  --demo-highlight: #26352B;
  --demo-highlight-clear: #26352B00;
  --player-surface: #202020;
  --player-rail: #454545;
  --player-rail-played: var(--brand);
  --player-control: #E6E6E6;
  --player-duration: #777777;
  --player-thumb-border: #A8A8A8;
  --player-menu-selected: #81A8FF;
  --brand-button: #327C5A;
  --brand-button-hover: #3C8B66;
  --brand-button-active: #28694D;
  --question-button: #9E603E;
  --danger-button: #A94D43;
  --danger-button-hover: #BA5B4D;
}

html[data-theme="dark"] .auth-header,
html[data-theme="dark"] .notebook-header { border-bottom-color: transparent; background: var(--canvas); }
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 { color: #E6E6E6; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 14px; font-weight: 700; }

.auth-view { min-height: 100dvh; }
.auth-header, .notebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  padding: 16px clamp(24px, 3.5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.auth-header-actions { display: flex; align-items: center; gap: 16px; }
.auth-header-actions > span { color: var(--muted); font-size: 14px; }
.auth-home-link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.auth-home-link:hover { color: var(--brand); }
.auth-home-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.theme-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.theme-toggle svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-icon-moon { fill: currentColor; stroke: none; }
.theme-toggle .theme-icon-sun, html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
.auth-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  align-items: center;
  gap: clamp(60px, 9vw, 150px);
  width: min(1120px, 100%);
  min-height: calc(100dvh - 86px);
  margin: 0 auto;
  padding: 48px clamp(24px, 4vw, 56px) 80px;
}
.auth-intro { max-width: 520px; }
.auth-intro h1 { margin: 0; font-size: clamp(34px, 3.8vw, 56px); font-weight: 700; letter-spacing: -.045em; line-height: 1.2; }
.auth-intro > p:last-child { max-width: 390px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.auth-panel { padding-left: clamp(24px, 3vw, 44px); border-left: 1px solid var(--line); }
.auth-heading-row h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.auth-heading-row p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.auth-modes { display: flex; gap: 24px; margin: 30px 0 23px; border-bottom: 1px solid var(--line); }
.auth-mode { min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; }
.auth-mode.is-active, .auth-mode[aria-pressed="true"] { border-bottom-color: var(--brand); color: var(--brand); font-weight: 700; }
.auth-form, .auth-field { display: flex; flex-direction: column; }
.auth-form { gap: 10px; }
.auth-field { gap: 10px; margin-top: 9px; }
.auth-form label { color: var(--ink); font-size: 14px; font-weight: 650; }
.auth-form input, .notebook-search, .new-course-controls input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
.auth-form input::placeholder, .notebook-search::placeholder, .new-course-controls input::placeholder { color: var(--placeholder); }
.auth-form .button { width: 100%; margin-top: 16px; }
.auth-message { min-height: 22px; margin: 15px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.auth-message[data-kind="error"] { color: var(--danger); }
.auth-preview { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.auth-preview button { padding: 4px 0; border: 0; background: transparent; color: var(--brand); font-size: 14px; font-weight: 700; }
.auth-preview button:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-preview small { flex-basis: 100%; font-size: 13px; line-height: 1.5; }

.notebook-view { min-height: 100dvh; }
.notebook-account { display: flex; align-items: center; gap: 16px; min-width: 0; color: var(--muted); font-size: 14px; }
#account-email { max-width: min(33vw, 330px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#signout-btn, .text-action { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--brand); font-size: 14px; font-weight: 650; }
#signout-btn:hover, .text-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.notebook-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100dvh - 86px); }
.notebook-layout.is-collapsed { grid-template-columns: minmax(0, 1fr); }
.notebook-layout.is-collapsed .notebook-sidebar { display: none; }
.notebook-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.notebook-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: calc(100dvh - 86px); padding: 32px 20px 22px 28px; overflow: hidden; border-right: 1px solid var(--line); }
.notebook-sidebar-top h1 { margin: 0 0 19px; font-size: 22px; letter-spacing: -.025em; }
.notebook-sidebar-top .button { width: 100%; }
.notebook-search-label { display: block; margin: 30px 0 8px; font-size: 14px; font-weight: 650; }
.notebook-search { min-height: 44px; padding: 0 10px; font-size: 14px; }
.notebook-search-scope { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.course-navigation { flex: 1; min-height: 0; margin-top: 32px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.course-navigation::-webkit-scrollbar, .source-pages::-webkit-scrollbar { width: 6px; }
.course-navigation::-webkit-scrollbar-track, .source-pages::-webkit-scrollbar-track { background: transparent; }
.course-navigation::-webkit-scrollbar-thumb, .source-pages::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--scroll-thumb); }
.nav-section-heading { padding: 0 8px 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.course-list { display: flex; flex-direction: column; }
.course-list > button, .course-list > a, .course-list .course-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}
.course-list > button:hover, .course-list > a:hover, .course-list .course-row:hover { background: var(--brand-soft); }
.course-list > .is-active, .course-list > [aria-current="page"], .course-list .course-row.is-active { border-left-color: var(--brand); color: var(--brand); font-weight: 700; }
.course-row small { margin-left: auto; color: var(--muted); font-size: 12px; }
.account-identity { display: flex; align-items: center; gap: 11px; flex: none; min-width: 0; }
.account-avatar { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 50%; background: var(--avatar-bg); color: var(--brand); font-size: 14px; font-weight: 750; line-height: 1; }
.account-copy { display: flex; flex-direction: column; min-width: 0; }
.account-name { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 680; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.account-tier { color: var(--muted); font-size: 12px; line-height: 1.4; }
.account-identity[data-tier="pro"] .account-tier { color: var(--brand); font-weight: 700; }
.account-identity[data-tier="enterprise"] .account-tier { color: var(--enterprise-tier); font-weight: 700; }
.account-identity-notebook { margin-top: 16px; }
.notebook-main { min-width: 0; max-width: 1180px; width: 100%; padding: 42px clamp(28px, 5vw, 72px) 80px; }
.notebook-main-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.notebook-main-heading .eyebrow { margin-bottom: 7px; }
.notebook-main-heading h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; }
.notebook-message { margin: 20px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.notebook-message[data-kind="error"] { color: var(--danger); }
.session-list { display: flex; flex-direction: column; margin-top: 18px; }
.session-list > button, .session-list > a, .session-list > article, .session-list .session-row {
  width: 100%;
  padding: 18px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.session-list > button:hover, .session-list > a:hover, .session-list .session-row:hover { color: var(--brand); }
.session-list .session-row { display: flex; align-items: center; gap: 12px; padding: 0 2px; }
.session-open { min-width: 0; flex: 1; padding: 18px 0; border: 0; background: transparent; color: inherit; text-align: left; }
.session-edit { flex: none; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--brand); font-size: 14px; font-weight: 650; }
.session-edit:hover { text-decoration: underline; text-underline-offset: 3px; }
.session-row time, .session-row strong, .session-row span { display: block; }
.session-row time { color: var(--muted); font-size: 13px; }
.session-row strong { margin-top: 5px; font-size: 18px; font-weight: 680; }
.session-row span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.session-list small, .session-list .session-meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.new-course-form { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.new-course-form label { display: block; margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.new-course-controls { display: flex; gap: 10px; max-width: 590px; }
.new-course-controls .button { flex: none; }

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--classroom-top) 0, var(--classroom-upper) 78px, var(--classroom-middle) 164px, var(--classroom-bottom) 290px);
}
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(170px, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
  min-height: 76px;
  padding: 10px clamp(20px, 2.2vw, 34px);
  background: transparent;
  flex: none;
}
.brand { display: inline-flex; align-items: center; flex: none; }
.brand-logo { display: block; width: 138px; height: auto; }
.brand-logo-dark { display: none; }
html[data-theme="dark"] .brand-logo-light { display: none; }
html[data-theme="dark"] .brand-logo-dark { display: block; }
.course-heading { min-width: 0; max-width: 280px; }
.course-heading span { color: var(--muted); font-size: 14px; }
.course-heading h1 { overflow: hidden; margin: 3px 0 0; font-size: 20px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.course-heading-meta { display: flex; align-items: center; gap: 12px; }
#back-to-notebook-btn { padding: 2px 0; border: 0; background: transparent; color: var(--brand); font-size: 14px; font-weight: 650; white-space: nowrap; }
#back-to-notebook-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.top-actions { display: flex; justify-content: flex-end; gap: 8px; }
.top-actions .button-outline { border-color: transparent; background: transparent; }
.top-actions .button-outline:hover:not(:disabled), .top-actions .upload-button:hover { border-color: transparent; background: var(--brand-soft); }
.lesson-player {
  position: absolute;
  top: 50%;
  left: var(--player-left, 34%);
  display: flex;
  align-items: center;
  min-width: 0;
  width: var(--player-width, min(48vw, 800px));
  min-height: 56px;
  visibility: hidden;
  transform: translateY(-50%);
}
.lesson-player[data-aligned="true"] { visibility: visible; }
.player-live, .player-demo { display: flex; align-items: center; min-width: 0; width: 100%; }
.player-live { justify-content: space-between; gap: 14px; color: var(--ink); }
.player-live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--brand); }
.player-live[data-state="paused"] .player-live-dot { background: var(--ai-source); }
.player-live[data-state="error"] .player-live-dot { background: var(--danger); }
.player-live[data-state="starting"] .player-live-dot,
.player-live[data-state="reconnecting"] .player-live-dot { background: #82958B; }
.player-live-label { min-width: 0; margin-right: auto; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.player-time { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.player-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 18px 44px;
  align-items: center;
  row-gap: 2px;
}
.player-demo-main { position: relative; grid-column: 1 / -1; grid-row: 1; height: 18px; }
.player-segments {
  position: absolute;
  top: 7px;
  right: 6px;
  left: 6px;
  display: grid;
  grid-template-columns: 26.5fr 19.5fr 10fr 20fr 22.5fr;
  gap: 5px;
  height: 4px;
  pointer-events: none;
}
.player-segments span { min-width: 0; border-radius: 99px; background: linear-gradient(to right, var(--player-rail-played) 0%, var(--player-rail-played) var(--segment-fill, 0%), var(--player-rail) var(--segment-fill, 0%), var(--player-rail) 100%); }
.player-demo .player-time { grid-column: 1; grid-row: 2; color: var(--player-control); font-size: 14px; font-weight: 500; }
.player-demo .player-time strong { font-weight: 600; }
.player-demo .player-time span { color: var(--player-duration); }
.player-demo-controls { display: flex; grid-column: 2; grid-row: 2; align-items: center; justify-content: center; gap: 6px; }
.player-toggle, .player-skip, .player-speed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--player-control);
  cursor: pointer;
}
.player-toggle svg { display: block; width: 23px; height: 23px; fill: currentColor; }
.player-skip svg { display: block; width: 24px; height: 24px; fill: currentColor; stroke: none; }
.player-toggle .player-icon-play, .player-toggle[data-playing="false"] .player-icon-pause { display: none; }
.player-toggle[data-playing="false"] .player-icon-play { display: block; transform: translateX(1px); }
.player-speed-wrap { position: relative; grid-column: 3; grid-row: 2; justify-self: end; }
.player-speed { width: auto; min-width: 54px; padding: 0 8px; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 500; }
.player-toggle:hover, .player-skip:hover, .player-speed:hover, .player-speed[aria-expanded="true"] { background: var(--player-rail); }
.player-toggle:active, .player-skip:active, .player-speed:active { transform: scale(.96); }
.player-toggle:focus-visible, .player-skip:focus-visible, .player-speed:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.player-speed-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 40;
  width: 100px;
  padding: 7px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--player-surface);
  box-shadow: 0 3px 14px #00000014;
}
.player-speed-menu::after { position: absolute; top: -6px; right: 21px; width: 10px; height: 10px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--player-surface); content: ''; transform: rotate(45deg); }
@media (min-width: 981px) {
  .topbar:has(.player-speed-menu:not([hidden])) { z-index: 1; }
}
@media (max-width: 980px) {
  .player-speed-menu { top: auto; bottom: calc(100% + 9px); }
  .player-speed-menu::after { top: auto; bottom: -6px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
}
.player-speed-menu button { display: block; width: 100%; min-height: 30px; padding: 4px 16px; border: 0; background: transparent; color: var(--player-control); font-size: 13px; font-variant-numeric: tabular-nums; text-align: left; }
.player-speed-menu button:hover { background: var(--player-rail); }
.player-speed-menu button[aria-checked="true"] { color: var(--player-menu-selected); }
.player-speed-menu button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--brand); outline-offset: -2px; }
.player-seek {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
.player-seek::-webkit-slider-runnable-track {
  height: 18px;
  background: transparent;
}
.player-seek::-moz-range-track { height: 18px; background: transparent; }
.player-seek::-moz-range-progress { height: 18px; background: transparent; }
.player-seek::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--player-thumb-border);
  border-radius: 50%;
  background: var(--player-surface);
}
.player-seek::-moz-range-thumb { width: 12px; height: 12px; border: 1px solid var(--player-thumb-border); border-radius: 50%; background: var(--player-surface); }
.player-seek:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-radius: 5px; }
.player-empty { color: var(--muted); font-size: 13px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.button-outline { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button-outline:hover:not(:disabled), .upload-button:hover { border-color: var(--brand); background: var(--brand-soft); }
.button-primary { border-color: var(--brand-button); background: var(--brand-button); color: var(--on-button); }
.button-primary:hover:not(:disabled) { background: var(--brand-button-hover); }
.button-primary:active:not(:disabled) { background: var(--brand-button-active); }
.button:disabled { opacity: .48; }
.upload-button { cursor: pointer; }
.upload-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

.session-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 36px;
  padding: 5px clamp(20px, 2.2vw, 34px);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  flex: none;
}
.session-live, .session-mode { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.session-live { color: var(--ink); font-weight: 650; }
.caption-reopen-btn { flex: none; padding: 5px 2px; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.caption-reopen-btn:hover { color: var(--brand-button-hover); }
.caption-reopen-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.save-status { margin-left: auto; padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.save-status:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.save-status:disabled { cursor: default; }
.save-status[data-state="saved"] { color: var(--brand); }
.save-status[data-state="error"], .save-status[data-state="pending"] { color: var(--question); }
.session-quick-controls { display: none; }
.status-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #82958B; }
body.live .status-dot { background: var(--danger); }
body.replay .status-dot { background: var(--brand); }
body.paused .status-dot { background: var(--ai-source); }
.strip-divider { width: 3px; height: 3px; margin: 0 3px; border-radius: 50%; background: #9DB1A4; }
.session-hint { margin: 0; text-align: right; }

.workspace {
  --sources-width: clamp(212px, 15.6vw, 248px);
  --understanding-width: clamp(370px, 27vw, 420px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--sources-width) minmax(0, 1fr) var(--understanding-width);
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  background: radial-gradient(ellipse 52% 27% at 48% 36%, var(--classroom-glow-main), transparent 76%), radial-gradient(ellipse 37% 19% at 83% 11%, var(--classroom-glow-edge), transparent 79%), radial-gradient(ellipse 46% 22% at 21% 77%, var(--classroom-glow-low), transparent 81%);
}
.workspace::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, var(--classroom-dot) .72px, transparent 1px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 93% 78% at 50% 49%, #000 19%, #0009 65%, transparent 99%);
  mask-image: radial-gradient(ellipse 93% 78% at 50% 49%, #000 19%, #0009 65%, transparent 99%);
  content: '';
}
.panel-resizer {
  position: absolute;
  top: 12px;
  bottom: 12px;
  z-index: 5;
  width: 12px;
  cursor: col-resize;
  touch-action: none;
}
.panel-resizer-sources { left: calc(12px + var(--sources-width)); }
.panel-resizer-understanding { right: calc(12px + var(--understanding-width)); }
.panel-resizer::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 42px;
  border-radius: 99px;
  background: var(--brand);
  opacity: 0;
  transform: translate(-50%, -50%);
  content: '';
}
.panel-resizer:hover::after, .panel-resizer:focus-visible::after, .panel-resizer.is-dragging::after { opacity: .75; }
.panel-resizer:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 5px; }
body.is-panel-resizing { cursor: col-resize; user-select: none; }
.classroom-sources, .lesson-pane, .understanding-pane, .transcript-pane, .question-pane { min-width: 0; }
.classroom-sources {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 19px 16px 20px 20px;
  border: 0;
  border-radius: 18px;
  background: var(--sources-bg);
}
.sources-intro { position: relative; padding-right: 37px; }
.sources-intro .panel-toggle { position: absolute; top: -9px; right: -6px; }
.panel-toggle, .panel-reopen {
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--muted);
}
.panel-toggle { display: inline-flex; width: 44px; height: 44px; flex: none; border-radius: 10px; background: transparent; }
.panel-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.panel-reopen:hover { color: var(--brand); }
.panel-toggle svg, .panel-reopen svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.panel-reopen {
  position: absolute;
  top: 12px;
  z-index: 6;
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}
.panel-reopen-sources { left: 12px; transform: translateX(-7px); }
.panel-reopen-understanding { right: 12px; transform: translateX(7px); }
.panel-reopen:focus-visible { outline: 2px solid var(--brand); outline-offset: -5px; border-radius: 8px; }
.panel-collapsed-account {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 6;
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.sources-intro h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.source-study-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: 100%; flex: none; margin-top: 13px; container-type: inline-size; }
.source-study-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 58px; padding: 6px 2px; border: 0; border-radius: 12px; background: var(--source-action-bg); color: var(--ink); font: inherit; font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; cursor: pointer; transition: background-color .16s ease; }
.source-study-action:hover { background: var(--source-action-hover); }
.source-study-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.source-study-action svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.source-study-action span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@container (min-width: 320px) {
  .source-study-action { flex-direction: row; gap: 7px; min-height: 35px; padding: 6px 8px; border-radius: 999px; font-size: 12px; text-align: left; }
}
@container (max-width: 159px) {
  .source-study-action { min-height: 44px; }
  .source-study-action span { display: none; }
}
.source-file-section { margin-top: 18px; padding: 0 0 20px; }
.sources-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.source-file-row { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.source-file-icon { display: block; flex: none; width: 24px; height: 24px; }
.source-file-icon[hidden] { display: none; }
.source-file-row strong { display: block; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.source-upload-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 40px; margin-top: 21px; border: 0; border-radius: 999px; background: var(--source-action-bg); color: var(--ink); font-size: 13px; font-weight: 650; cursor: pointer; }
.source-upload-action[hidden] { display: none; }
.source-upload-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.source-upload-action:hover:not(:disabled) { background: var(--source-action-hover); }
.source-upload-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.source-upload-action:disabled { opacity: .5; }
.source-pages { flex: 1; min-height: 100px; margin-top: 23px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.source-pages-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-pages-heading > span:last-child { color: var(--muted); font-size: 12px; white-space: nowrap; }
.source-page-list { margin-top: 10px; }
.source-empty { margin: 0; padding: 13px 3px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.source-page-row { display: block; width: 100%; padding: 10px 9px 10px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; transition: background-color .16s ease; }
.source-page-row + .source-page-row { margin-top: 2px; }
.source-page-row:hover { background: var(--brand-soft); }
.source-page-row.is-current { background: var(--source-page-current); }
.source-page-number { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-page-number { font-size: 13px; font-weight: 680; }
.sources-footnote { display: flex; justify-content: space-between; gap: 8px; flex: none; padding-top: 12px; color: var(--muted); font-size: 12px; }
.sources-footnote strong { color: var(--brand); font-weight: 650; }
.account-identity-classroom { margin-top: 16px; }
.lesson-pane { position: relative; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 14px clamp(18px, 2vw, 40px) 42px; background: transparent; }
.lesson-pane > .section-title-row, .lesson-pane > .slide-surface, .lesson-pane > .source-legend { max-width: 1000px; margin-right: auto; margin-left: auto; }
.understanding-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 0; border-radius: 18px; background: var(--understanding-bg); }
.classroom-sources, .lesson-pane, .transcript-list, .question-pane, .notes-pane { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.classroom-sources::-webkit-scrollbar, .lesson-pane::-webkit-scrollbar, .transcript-list::-webkit-scrollbar, .question-pane::-webkit-scrollbar, .notes-pane::-webkit-scrollbar { width: 6px; height: 6px; }
.classroom-sources::-webkit-scrollbar-track, .lesson-pane::-webkit-scrollbar-track, .transcript-list::-webkit-scrollbar-track, .question-pane::-webkit-scrollbar-track, .notes-pane::-webkit-scrollbar-track { background: transparent; }
.classroom-sources::-webkit-scrollbar-thumb, .lesson-pane::-webkit-scrollbar-thumb, .transcript-list::-webkit-scrollbar-thumb, .question-pane::-webkit-scrollbar-thumb, .notes-pane::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--scroll-thumb); }
.understanding-header { flex: none; padding: 17px 19px 0; }
.understanding-header-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.understanding-header-actions { display: flex; align-items: center; gap: 2px; }
.understanding-header h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.understanding-tabs { display: flex; gap: 5px; margin: 18px 0 7px; }
.understanding-tab { position: relative; display: inline-flex; flex: none; align-items: center; gap: 7px; min-height: 35px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background-color .18s ease, color .18s ease; }
.understanding-tab::before { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; opacity: .48; content: ''; }
.understanding-tab:hover:not(.is-active) { background: var(--understanding-tab-hover); color: var(--ink); }
.understanding-tab.is-active { background: var(--understanding-tab-active); color: var(--ink); font-weight: 720; }
.understanding-tab.is-active::before { background: var(--brand); opacity: 1; }
.understanding-tab.has-unread:not(.is-active)::after { position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--question); content: ''; }
.floating-caption {
  position: fixed;
  z-index: 23;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 32px));
  height: 138px;
  padding: 10px 12px 11px;
  overflow: visible;
  border: 0;
  border-radius: 13px;
  background: rgba(10, 13, 12, .86);
  color: #F5F7F5;
  box-shadow: 0 12px 32px #00000035;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-theme="dark"] .floating-caption {
  border: 1px solid rgba(135, 201, 168, .18);
  background: rgba(42, 55, 46, .94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48);
}
html[data-theme="dark"] .floating-caption-status { color: #AED8BA; }
.floating-caption-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-bottom: 5px; cursor: grab; touch-action: none; user-select: none; }
.floating-caption-top:active { cursor: grabbing; }
.floating-caption.is-pinned .floating-caption-top { cursor: default; }
.floating-caption-status { color: #B9C9BF; font-size: 11px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.floating-caption-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.floating-caption-language { position: relative; display: inline-flex; align-items: center; gap: 4px; color: #B9C9BF; font-size: 11px; white-space: nowrap; }
.floating-caption-language-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 29px; padding: 4px 7px; border: 1px solid #B9DFC733; border-radius: 7px; background: #FFFFFF14; color: #F5F7F5; font: inherit; font-size: 11px; cursor: pointer; }
.floating-caption-language-trigger:hover, .floating-caption-language-trigger[aria-expanded="true"] { background: #FFFFFF24; border-color: #B9DFC766; }
.floating-caption-language-trigger svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.floating-caption-language-menu { position: absolute; z-index: 2; top: calc(100% + 6px); right: 0; width: 138px; padding: 4px; border: 1px solid #A8C8B54D; border-radius: 9px; background: #26362D; box-shadow: 0 13px 30px #00000066; }
.floating-caption-language-menu.opens-up { top: auto; bottom: calc(100% + 6px); }
.floating-caption-language-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #ECF3EE; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.floating-caption-language-menu button:hover, .floating-caption-language-menu button:focus-visible { outline: none; background: #FFFFFF1A; }
.floating-caption-language-menu button[aria-checked="true"] { background: #B9DFC72A; color: #C9EBD5; }
.floating-caption-language-menu button span { color: #B9DFC7; font-size: 13px; }
.floating-caption-language-menu button[aria-checked="false"] span { opacity: 0; }
.floating-caption-pin, .floating-caption-close, .floating-caption-resize { display: grid; flex: none; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #B9C9BF; cursor: pointer; }
.floating-caption-pin, .floating-caption-close { width: 30px; height: 30px; }
.floating-caption-pin:hover, .floating-caption-pin[aria-pressed="true"], .floating-caption-close:hover { background: #FFFFFF1A; color: #B9DFC7; }
.floating-caption-pin svg, .floating-caption-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.floating-caption-copy { flex: 1; min-height: 0; padding-right: 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #A7B7AB88 transparent; }
.floating-caption-list { display: flex; flex-direction: column; gap: 5px; }
.floating-caption-entry { position: relative; min-width: 0; padding: 8px 42px 9px 14px; border-radius: 10px; }
.floating-caption-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 3px; line-height: 1.4; }
.speaker-identity { display: inline-flex; flex: none; align-items: center; gap: 5px; min-height: 28px; margin-left: -5px; padding: 2px 5px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: left; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.speaker-identity:hover, .speaker-identity:focus-visible, .speaker-identity[aria-expanded="true"] { outline: none; border-color: var(--line); background: var(--paper); box-shadow: 0 3px 11px #10231B20; }
html[data-theme="dark"] .speaker-identity:hover, html[data-theme="dark"] .speaker-identity:focus-visible, html[data-theme="dark"] .speaker-identity[aria-expanded="true"] { box-shadow: 0 4px 13px #00000055; }
.transcript-meta .speaker-identity:hover, .transcript-meta .speaker-identity:focus-visible, .transcript-meta .speaker-identity[aria-expanded="true"] { box-shadow: 0 2px 6px #10231B20; }
html[data-theme="dark"] .transcript-meta .speaker-identity:hover, html[data-theme="dark"] .transcript-meta .speaker-identity:focus-visible, html[data-theme="dark"] .transcript-meta .speaker-identity[aria-expanded="true"] { box-shadow: 0 2px 6px #00000055; }
.speaker-avatar { display: block; flex: none; width: 22px; height: 22px; object-fit: contain; }
.floating-caption-meta .speaker-identity { gap: 4px; min-height: 24px; margin-left: -4px; padding: 2px 4px; }
.floating-caption-meta .speaker-identity:hover, .floating-caption-meta .speaker-identity:focus-visible, .floating-caption-meta .speaker-identity[aria-expanded="true"] { border-color: #B9DFC744; background: #FFFFFF1A; box-shadow: 0 3px 10px #00000044; }
.floating-caption-meta .speaker-avatar { width: 18px; height: 18px; }
.floating-caption-speaker { color: #B9DFC7; font-size: 10px; font-weight: 700; white-space: nowrap; }
.floating-caption-entry[data-speaker-tone="1"] .floating-caption-speaker { color: #FFAA82; }
.floating-caption-entry[data-speaker-tone="2"] .floating-caption-speaker { color: #85D2F1; }
.floating-caption-entry[data-speaker-tone="3"] .floating-caption-speaker { color: #D9B5F2; }
.floating-caption-entry[data-speaker-tone="4"] .floating-caption-speaker { color: #A4DDCF; }
.speaker-profile-card { position: fixed; z-index: 90; box-sizing: border-box; overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 44px #10231B2B, 0 3px 10px #10231B14; }
html[data-theme="dark"] .speaker-profile-card { box-shadow: 0 18px 48px #00000088, 0 3px 12px #00000044; }
.speaker-profile-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.speaker-profile-card-header h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.speaker-profile-close { display: grid; flex: none; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.speaker-profile-close:hover, .speaker-profile-close:focus-visible { outline: none; background: var(--brand-soft); color: var(--ink); }
.speaker-profile-form { margin-top: 10px; }
.speaker-profile-label { display: block; margin: 0 0 8px; color: var(--ink); font-size: 11px; font-weight: 680; line-height: 1.4; }
.speaker-profile-name { box-sizing: border-box; display: block; width: 100%; height: 34px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--field-bg); color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; }
.speaker-profile-name:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.speaker-profile-choices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.speaker-profile-choice { position: relative; display: flex; min-width: 0; height: 42px; align-items: flex-start; justify-content: center; padding: 2px 0 8px; border: 0; background: transparent; cursor: pointer; }
.speaker-profile-choice::after { position: absolute; bottom: 1px; left: calc(50% - 2.5px); width: 5px; height: 5px; border-radius: 50%; background: var(--brand); content: ''; opacity: 0; }
.speaker-profile-choice[aria-pressed="true"]::after { opacity: 1; }
.speaker-profile-choice:focus-visible { outline: none; }
.speaker-profile-choice:focus-visible .speaker-profile-choice-image { outline: 2px solid var(--brand); outline-offset: 2px; }
.speaker-profile-choice-image { display: block; width: 32px; max-width: 100%; height: 32px; border-radius: 50%; object-fit: contain; transition: transform .16s ease, filter .16s ease; }
.speaker-profile-choice:hover .speaker-profile-choice-image { transform: scale(1.08); filter: drop-shadow(0 2px 4px #10231B40); }
.speaker-profile-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.speaker-profile-actions button { min-width: 56px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--field-bg); color: var(--ink); font: inherit; font-size: 12px; font-weight: 680; cursor: pointer; }
.speaker-profile-actions button:hover { background: var(--brand-soft); }
.speaker-profile-actions .speaker-profile-save { border-color: var(--brand-button); background: var(--brand-button); color: var(--on-button); }
.speaker-profile-actions .speaker-profile-save:hover { background: var(--brand-button-hover); }
.floating-caption-time { color: #AFC1B3; font-size: 10px; font-variant-numeric: tabular-nums; }
.floating-caption-empty { margin: 2px 0 0; color: #E2E8E3; font-size: 13px; line-height: 1.45; }
.floating-caption-en, .floating-caption-zh { margin: 0; overflow-wrap: anywhere; }
.floating-caption-en { color: #DCE5DE; font-size: 12px; line-height: 1.45; }
.floating-caption-zh { margin-top: 4px; color: #B9DFC7; font-size: 13px; font-weight: 580; line-height: 1.5; }
.floating-caption-list > .floating-caption-entry:first-child .floating-caption-time { color: #C6DDCB; font-size: 11px; }
.floating-caption-list > .floating-caption-entry:first-child .floating-caption-en { color: #F5F7F5; font-size: 17px; font-weight: 640; line-height: 1.4; }
.floating-caption-list > .floating-caption-entry:first-child .floating-caption-zh { margin-top: 6px; color: #C9EBD5; font-size: 20px; font-weight: 700; line-height: 1.42; }
.floating-caption.is-compact .floating-caption-list > .floating-caption-entry:first-child .floating-caption-en { font-size: 14px; }
.floating-caption.is-compact .floating-caption-list > .floating-caption-entry:first-child .floating-caption-zh { font-size: 16px; }
.floating-caption-entry.is-interim .floating-caption-time { color: #B9DFC7; }
.floating-caption-resize { position: absolute; right: 0; bottom: 0; width: 31px; height: 31px; cursor: nwse-resize; touch-action: none; }
.floating-caption-resize svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.6; }
.floating-caption-resize:hover { color: #F5F7F5; }
.floating-caption.is-pinned .floating-caption-resize { display: none; }
.floating-caption-language-trigger:focus-visible, .floating-caption-pin:focus-visible, .floating-caption-close:focus-visible, .floating-caption-resize:focus-visible { outline: 2px solid #B9D6C4; outline-offset: -2px; }
.floating-caption [hidden] { display: none !important; }
.floating-caption.is-compact .floating-caption-top { align-items: stretch; flex-direction: column; gap: 2px; min-height: 61px; }
.floating-caption.is-compact .floating-caption-actions { justify-content: space-between; }
.floating-caption.is-compact .floating-caption-language > span { display: none; }
.floating-caption.is-compact .floating-caption-language-trigger { max-width: 94px; }
.understanding-pane .transcript-pane, .understanding-pane .question-pane, .understanding-pane .notes-pane { display: none; flex: 1; flex-direction: column; min-height: 0; padding: 0 19px 25px; }
.understanding-pane [data-panel].is-understanding-active { display: flex; }
.understanding-pane .section-title-row { display: none; }
.notes-pane { overflow-y: auto; }
.notes-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 20px 0 12px; }
.notes-intro p { margin: 0; font-size: 13px; font-weight: 650; }
.notes-intro span { color: var(--muted); font-size: 12px; text-align: right; }
.notes-intro span[data-state="error"] { color: var(--danger); }
.notes-intro span[data-state="pending"] { color: var(--question); }
.note-conflict { margin: 0 0 12px; color: var(--question); font-size: 13px; line-height: 1.5; }
.note-conflict p { margin: 0 0 4px; }
.note-conflict > div { display: flex; flex-wrap: wrap; gap: 12px; }
.note-conflict button { min-height: 34px; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 680; text-decoration: underline; text-underline-offset: 3px; }
.note-conflict button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.manual-notes-toolbar { display: block; margin: 0 0 12px; }
.manual-notes-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.manual-notes-tools button { min-width: 34px; min-height: 36px; padding: 4px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.manual-notes-tools button:hover, .manual-notes-tools button.trix-active { background: var(--brand-soft); color: var(--brand); }
.manual-notes-tools button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.manual-notes-tools button:disabled { opacity: .4; cursor: default; }
.manual-notes-tools-spacer { flex: 1; min-width: 0; }
trix-editor#manual-note-editor { display: block; flex: 1; width: 100%; min-height: 230px; padding: 3px 0 40px; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
trix-editor#manual-note-editor:empty:not(:focus)::before { color: var(--placeholder); }
trix-editor#manual-note-editor h1 { margin: 15px 0 8px; font-size: 1.25em; }
trix-editor#manual-note-editor blockquote { margin: 12px 0; padding-left: 12px; border-left: 2px solid var(--brand); color: var(--muted); }
trix-editor#manual-note-editor ul, trix-editor#manual-note-editor ol { padding-left: 1.35em; }
trix-editor#manual-note-editor a { color: var(--brand); }
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  margin-bottom: 14px;
}
.section-title-row h2 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
.section-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.sources-drawer-trigger { display: none; }
.surface { min-width: 0; }
.slide-surface { display: flex; flex-direction: column; }
.surface-toolbar, .transcript-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 10px 0;
}
.toolbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-glyph {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: var(--brand);
  font-size: 13px;
  font-weight: 750;
}
.toolbar-title strong, .toolbar-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-title strong { font-size: 15px; }
.toolbar-title small { margin-top: 2px; color: var(--muted); font-size: 14px; }
.slide-page-frame { position: relative; min-width: 0; padding-inline: clamp(28px, 2.4vw, 42px); }
.page-side-nav {
  position: absolute;
  z-index: 12;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #78817b;
  transform: translate(-50%, -50%);
  transition: color .18s ease, transform .18s ease;
}
.page-side-nav::before {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #e4e7e4;
  content: '';
  transition: background-color .18s ease;
}
.page-side-nav svg {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .72;
  pointer-events: none;
  transition: opacity .18s ease;
}
.page-side-nav:hover:not(:disabled), .page-side-nav:focus-visible:not(:disabled) {
  color: #5f6861;
  transform: translate(-50%, -50%) scale(1.06);
}
.page-side-nav:hover:not(:disabled) svg, .page-side-nav:focus-visible:not(:disabled) svg { opacity: 1; }
.page-side-nav:hover:not(:disabled)::before, .page-side-nav:focus-visible:not(:disabled)::before {
  background: #d6dcd7;
}
.page-side-nav:disabled { opacity: .52; }
.page-side-nav:disabled svg { opacity: .58; }
.page-side-nav:focus-visible { outline: 2px solid #a9b0aa; outline-offset: 1px; }
.slide-fullscreen-toggle {
  position: absolute;
  z-index: 20;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7A7A7A;
  cursor: pointer;
  transform: translateX(-100%);
  transition: color .18s ease;
}
.slide-fullscreen-toggle[hidden] { display: none !important; }
.slide-fullscreen-toggle::before {
  position: absolute;
  inset: 5px;
  border-radius: 7px;
  background: #edeFED;
  box-shadow: 0 2px 8px #26352d24;
  content: '';
  opacity: 0;
  transition: opacity .18s ease;
}
.slide-fullscreen-toggle:hover,
.slide-fullscreen-toggle:focus-visible { color: #5f6661; }
.slide-fullscreen-toggle:hover::before,
.slide-fullscreen-toggle:focus-visible::before { opacity: 1; }
.slide-fullscreen-toggle:focus-visible { outline: 2px solid #9ba9a0; outline-offset: 2px; }
.slide-fullscreen-toggle svg { position: relative; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slide-fullscreen-toggle__shrink { display: none; }
.pdf-container { height: auto; min-height: 390px; overflow: visible; background: transparent; }
.pdf-workspace__toolbar { display: none !important; }
.pdf-workspace__notice { padding: 8px 16px !important; font-size: 14px !important; color: var(--muted) !important; }
.pdf-workspace__stage { border-radius: 12px; background: transparent; }
.pdf-workspace__sheet { margin: 0 auto; overflow: hidden; border-radius: 12px; background: #fff; }
.pdf-workspace__sheet.is-layout-transition {
  width: var(--slide-visual-width) !important;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: var(--slide-page-ratio);
  transition: width 260ms cubic-bezier(.2, .7, .2, 1);
}
.pdf-workspace__sheet.is-layout-transition > .pdf-workspace__canvas {
  width: 100% !important;
  height: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  .pdf-workspace__sheet.is-layout-transition { transition: none; }
}
.pdf-workspace__native-preview { border-radius: 12px; }
.pdf-container canvas { display: block; max-width: 100%; height: auto !important; margin: auto; background: #fff; }
.pdf-container > .empty-state { padding: 32px; }

/* Keep the drawing launcher beside the page; use an in-flow toolbar slot when the gutter is too narrow. */
.drawing-toolbar { position: sticky; top: 12px; z-index: 35; width: 0; height: 0; align-self: flex-start; overflow: visible; }
.drawing-toolbar.is-inline { position: relative; top: auto; width: 44px; height: 44px; flex: 0 0 44px; align-self: center; }
.drawing-toolbar__dock { position: absolute; top: 3px; display: flex; flex-direction: column; align-items: center; width: 44px; pointer-events: auto; }
.drawing-toolbar.is-inline .drawing-toolbar__dock { top: 1px; }
.drawing-toolbar__toggle, .drawing-toolbar__tool, .drawing-toolbar__subtool {
  display: grid; flex: none; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.drawing-toolbar__toggle { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); box-shadow: 0 4px 16px #12261D18; }
.drawing-toolbar__toggle:hover:not(:disabled), .drawing-toolbar__tool:hover, .drawing-toolbar__subtool:hover { background: var(--brand-soft); color: var(--brand); }
.drawing-toolbar__toggle.is-open, .drawing-toolbar__tool.is-selected, .drawing-toolbar__subtool.is-selected { background: var(--brand-soft); color: var(--brand); }
.drawing-toolbar__toggle:active, .drawing-toolbar__tool:active, .drawing-toolbar__subtool:active { transform: scale(.94); }
.drawing-toolbar__toggle:focus-visible, .drawing-toolbar__tool:focus-visible, .drawing-toolbar__subtool:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.drawing-toolbar__toggle:disabled { opacity: .45; box-shadow: none; }
.drawing-toolbar svg { display: block; width: 24px; height: 24px; }
.drawing-toolbar__toggle svg { width: 24px; height: 24px; }
.drawing-toolbar__current-color {
  display: grid; flex: none; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  transition: background-color .16s ease, transform .16s ease;
}
.drawing-toolbar__current-color svg { color: var(--drawing-current-color, #175F50); }
.drawing-toolbar__current-color:hover, .drawing-toolbar__current-color[aria-expanded="true"] { background: var(--brand-soft); }
.drawing-toolbar__current-color:active { transform: scale(.94); }
.drawing-toolbar__current-color:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.drawing-toolbar__rail, .drawing-toolbar__flyout {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--paper);
  box-shadow: 0 8px 28px #11261D24;
}
.drawing-toolbar__rail {
  margin-top: 0; max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0;
  overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-7px);
  transition: max-height .28s cubic-bezier(.22, 1, .36, 1),
    margin-top .28s cubic-bezier(.22, 1, .36, 1),
    padding-top .28s cubic-bezier(.22, 1, .36, 1), padding-bottom .28s cubic-bezier(.22, 1, .36, 1),
    border-width .28s cubic-bezier(.22, 1, .36, 1), opacity .18s ease,
    transform .28s cubic-bezier(.22, 1, .36, 1), visibility 0s .28s;
}
.drawing-toolbar__rail.is-expanded {
  margin-top: 8px; max-height: var(--rail-open-height, 320px);
  padding-top: 5px; padding-bottom: 5px; border-width: 1px;
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  transition-delay: 0s;
}
.drawing-toolbar__rail.is-expanded > * {
  animation: drawing-tool-reveal .18s ease-out backwards;
  animation-delay: calc(var(--rail-order, 0) * 22ms);
}
@keyframes drawing-tool-reveal {
  from { opacity: 0; transform: translateY(-5px); }
}
.drawing-toolbar__flyout { position: absolute; left: 52px; z-index: 2; width: 46px; }
.drawing-toolbar__options {
  position: absolute; left: 106px; z-index: 3; width: 234px; padding: 15px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 12px 36px #11261D2E;
}
.drawing-toolbar__option-title { display: block; margin-bottom: 14px; font-size: 14px; }
.drawing-toolbar__palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.drawing-toolbar__swatch { width: 27px; height: 27px; padding: 0; border: 2px solid var(--paper); border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); }
.drawing-toolbar__swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand); }
.drawing-toolbar__custom-color { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 13px; }
.drawing-toolbar__custom-color input { width: 38px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.drawing-toolbar__range { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.drawing-toolbar__range input { grid-column: 1; width: 100%; accent-color: var(--brand); }
.drawing-toolbar__range output { grid-column: 2; grid-row: 2; min-width: 32px; color: var(--ink); text-align: right; }
html[data-theme="dark"] .drawing-toolbar__rail, html[data-theme="dark"] .drawing-toolbar__flyout,
html[data-theme="dark"] .drawing-toolbar__toggle, html[data-theme="dark"] .drawing-toolbar__options { box-shadow: 0 10px 32px #0009; }

.drawing-overlay, .drawing-text-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.drawing-overlay { z-index: 4; overflow: hidden; pointer-events: none; }
.drawing-overlay.is-active { pointer-events: auto; touch-action: none; cursor: crosshair; }
.drawing-overlay__preview { stroke-dasharray: 3 2; }
.drawing-text-layer { z-index: 5; pointer-events: none; }
.drawing-text-mark { position: absolute; min-width: 82px; max-width: min(230px, 42%); pointer-events: auto; }
.drawing-text-layer.is-pass-through .drawing-text-mark { pointer-events: none; }
.drawing-text-mark--sticky { width: 190px; padding: 8px; border: 1px solid #E3D3A8; border-left: 3px solid var(--drawing-accent); border-radius: 9px; background: #FFF3CEED; box-shadow: 0 4px 12px #2A281724; }
.drawing-text-mark--text { width: 190px; padding: 3px 5px; border-radius: 5px; background: #FFFDF7D9; }
.drawing-text-mark__editor { display: block; width: 100%; min-height: 32px; max-height: 230px; padding: 2px; resize: vertical; overflow-y: auto; border: 0; outline: 0 !important; background: transparent; color: #20342B; font-size: 14px; line-height: 1.5; }
.drawing-text-mark__editor::placeholder { color: #69756F; }
.drawing-text-mark__editor:focus-visible { outline: 0 !important; }
.annotation-area { padding: 22px 0 0; }
.subsection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.subsection-heading h3 { margin: 0; font-size: 17px; }
.subsection-heading span { color: var(--muted); font-size: 14px; text-align: right; }
.annotation-list { display: flex; flex-direction: column; margin-top: 12px; }
.empty-state { margin: 0; padding: 18px 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.annotation-item {
  display: block;
  width: 100%;
  padding: 13px 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.annotation-item:hover .annotation-quote { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.annotation-source, .annotation-page, .annotation-quote, .annotation-explanation { display: block; }
.annotation-source { color: var(--slide-source); font-size: 14px; font-weight: 700; }
.annotation-item[data-source="teacher"] .annotation-source { color: var(--teacher-source); }
.annotation-item[data-source="ai"] .annotation-source { color: var(--ai-source); }
.annotation-page { margin-top: 3px; color: var(--muted); font-size: 14px; }
.annotation-quote { margin-top: 9px; font-size: 15px; line-height: 1.5; }
.annotation-explanation { margin-top: 5px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.source-legend { display: flex; align-items: center; gap: 13px 20px; flex-wrap: wrap; padding: 16px 3px 0; color: var(--muted); font-size: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; }
.legend-dot.slide { background: var(--slide-source); }
.legend-dot.speech { background: var(--teacher-source); }
.legend-dot.ai { background: var(--ai-source); }

.transcript-surface { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; }
.transcript-toolbar { min-height: 42px; }
.transcript-toolbar strong { font-size: 15px; }
.transcript-toolbar span { color: var(--muted); font-size: 14px; }
@media (min-width: 981px) {
  .transcript-surface.is-scrolled .transcript-toolbar { position: relative; z-index: 1; }
  .transcript-surface.is-scrolled .transcript-toolbar::after {
    position: absolute;
    top: 100%;
    right: 8px;
    left: 0;
    height: 30px;
    background: linear-gradient(to bottom, var(--understanding-bg), transparent);
    pointer-events: none;
    content: '';
  }
}
.transcript-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 4px 0 16px;
  overflow-y: auto;
  scrollbar-color: var(--scroll-thumb) transparent;
}
.transcript-item { padding: 17px 12px; }
.transcript-item.is-interim { opacity: .65; }
.transcript-item.is-demo-seekable { cursor: pointer; }
.transcript-item.is-demo-seekable:hover .transcript-en,
.transcript-item.is-demo-seekable:focus-visible .transcript-en { color: var(--brand); }
.transcript-item.is-demo-seekable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.transcript-item.is-demo-current { background: linear-gradient(90deg, var(--demo-highlight-clear), var(--demo-highlight) 10%, var(--demo-highlight) 62%, var(--demo-highlight-clear) 100%); }
.transcript-item.is-demo-current .transcript-time { color: var(--brand); }
.transcript-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 7px; line-height: 1.35; }
.transcript-speaker { color: var(--brand); font-size: 14px; font-weight: 650; white-space: nowrap; }
.transcript-item[data-speaker-tone="1"] .transcript-speaker { color: var(--speaker-1); }
.transcript-item[data-speaker-tone="2"] .transcript-speaker { color: var(--speaker-2); }
.transcript-item[data-speaker-tone="3"] .transcript-speaker { color: var(--speaker-3); }
.transcript-item[data-speaker-tone="4"] .transcript-speaker { color: var(--speaker-4); }
.transcript-time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.transcript-en { margin: 0 0 7px; font-size: 16px; line-height: 1.55; }
.transcript-zh { margin: 0; color: var(--brand); font-size: 18px; font-weight: 550; line-height: 1.65; }
.latest-button {
  position: absolute;
  right: 16px;
  bottom: 15px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--brand-button);
  border-radius: 24px;
  background: var(--brand-button);
  color: var(--on-button);
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 5px 20px #1D322B26;
}

.question-bubble {
  position: fixed;
  z-index: 40;
  width: 380px;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateY(-10px) scale(.985);
  pointer-events: none;
  transition: opacity 260ms ease, transform 310ms cubic-bezier(.2, .7, .2, 1);
}
.question-bubble.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.question-bubble-list { display: flex; flex-direction: column; gap: 10px; max-height: inherit; padding: 4px 5px 8px; overflow-y: auto; border: 0; background: transparent; box-shadow: none; scrollbar-width: thin; scrollbar-color: #B5D9C2 transparent; }
.question-bubble-item {
  flex: none;
  max-height: 190px;
  overflow: hidden;
  padding: 9px 11px 8px;
  border: 0;
  border-radius: 14px;
  background: var(--question-bubble-bg);
  color: #FFFFFF;
  box-shadow: none;
  transform-origin: center;
  transition: max-height 340ms cubic-bezier(.2, .7, .2, 1), padding 340ms cubic-bezier(.2, .7, .2, 1), opacity 260ms ease, transform 240ms cubic-bezier(.2, .7, .2, 1), background 260ms ease;
}
.question-bubble-item.is-compact { max-height: 96px; padding: 7px 10px; background: var(--question-bubble-compact); }
.question-bubble-item.is-entering, .question-bubble-item.is-leaving { max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; opacity: 0; transform: translateY(-9px); pointer-events: none; }
.question-bubble-item:not(.is-entering, .is-leaving):has(button:focus-visible) {
  background: #3B8965;
  transform: scale(1.01);
}
.question-bubble-item.is-compact:has(button:focus-visible) { background: #30765A; }
@media (hover: hover) {
  .question-bubble-item:not(.is-entering, .is-leaving):hover {
    background: #3B8965;
    transform: scale(1.01);
  }
  .question-bubble-item.is-compact:hover { background: #30765A; }
}
.question-bubble-head { display: flex; align-items: center; min-height: 20px; gap: 7px; }
.question-bubble button:not(:disabled) { cursor: pointer; }
.question-bubble-mark { display: grid; flex: none; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #FFFFFF30; color: #FFFFFF; font-size: 12px; font-weight: 800; line-height: 1; }
.question-bubble-label { min-width: 0; color: #FFFFFF; font-size: 11px; font-weight: 750; letter-spacing: .02em; }
.question-bubble-close { display: grid; flex: none; place-items: center; width: 25px; height: 25px; margin: -3px -5px -3px auto; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #FFFFFFD6; }
.question-bubble-close:hover { background: #FFFFFF24; color: #FFFFFF; }
.question-bubble-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.question-bubble-text { display: -webkit-box; width: 100%; overflow: hidden; margin: 3px 0 0; padding: 0; border: 0; background: transparent; color: #FFFFFF; text-align: left; font-size: 12.5px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.question-bubble-text:hover { color: #E7F8EA; }
.question-bubble-item.is-compact .question-bubble-text { display: block; white-space: nowrap; text-overflow: ellipsis; }
.question-bubble-detail { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 300ms cubic-bezier(.2, .7, .2, 1), opacity 220ms ease; }
.question-bubble-item.is-compact .question-bubble-detail { grid-template-rows: 0fr; opacity: 0; }
.question-bubble-actions { display: flex; align-items: center; gap: 6px; min-height: 0; overflow: hidden; padding-top: 7px; transition: padding-top 300ms cubic-bezier(.2, .7, .2, 1); }
.question-bubble-item.is-compact .question-bubble-actions { padding-top: 0; }
.question-bubble-actions button { min-height: 26px; padding: 3px 10px; border: 0; border-radius: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.question-bubble-answer { background: #FFFFFF; color: #1D6144; }
.question-bubble-answer:hover { background: #E8F5EB; }
.question-bubble-hint { background: transparent; color: #FFFFFF; }
.question-bubble-hint:hover { background: #FFFFFF24; }
.question-bubble-hint span { margin-left: 2px; }
.question-bubble button:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.question-bubble.is-instant, .question-bubble.is-instant * { transition: none !important; animation: none !important; }
.question-action, .mobile-question-action {
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--question);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.question-action:hover, .mobile-question-action:hover { background: var(--question-soft); }
.question-context .button-outline { border-color: transparent; background: transparent; color: var(--brand); }
.question-context .button-outline:hover { border-color: transparent; background: var(--brand-soft); }
.question-pane { overflow-y: auto; }
.question-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
  padding: 18px 0;
}
.question-context-copy { min-width: 0; }
.question-context strong { color: var(--brand); font-size: 14px; }
.question-context p { margin: 5px 0 0; font-size: 15px; line-height: 1.5; }
.question-context #question-context-zh { color: var(--brand); font-size: 16px; }
.question-context .button { display: none; flex: none; }
.question-card { min-height: 216px; padding: 18px 0 0; }
.question-card .empty-state { max-width: 430px; padding: 7px 0; }
.question-history { display: flex; flex-wrap: nowrap; gap: 13px; margin-bottom: 17px; overflow-x: auto; scrollbar-width: thin; }
.question-history button {
  flex: none;
  min-height: 44px;
  max-width: 245px;
  padding: 7px 2px;
  overflow: hidden;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.question-history button.is-selected { border-bottom-color: var(--question); color: var(--question); font-weight: 700; }
.question-kicker { color: var(--question); font-size: 14px; font-weight: 700; }
.question-english { margin: 8px 0; font-size: 17px; font-weight: 600; line-height: 1.5; }
.question-chinese { margin: 0 0 13px; color: var(--brand); font-size: 18px; line-height: 1.6; }
.question-section { padding: 14px 0; }
.question-section-title { color: var(--question); font-size: 14px; font-weight: 700; }
.question-section p, .question-points { margin: 7px 0 0; font-size: 15px; line-height: 1.7; }
.question-points { padding-left: 22px; }
.question-points li + li { margin-top: 5px; }
.question-draft-editor, .question-dialog-input {
  display: block;
  width: 100%;
  min-height: 90px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}
.question-source { display: block; margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.question-error { margin: 9px 0 0; color: var(--danger); font-size: 15px; line-height: 1.6; }
.question-waiting { color: var(--muted); }
.question-dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 70px #1D322B33; }
.question-dialog::backdrop { background: #1D322B66; }
.question-dialog h2 { margin: 0; font-size: 21px; }
.question-dialog p { margin: 8px 0 17px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.question-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.question-dialog-actions button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--field-bg); color: var(--ink); font-size: 14px; }
.question-dialog-actions button[type="submit"] { border-color: var(--question-button); background: var(--question-button); color: var(--on-button); }

.app-footer { display: none; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: min(390px, calc(100vw - 32px)); padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 30px #1D322B1F; font-size: 14px; line-height: 1.55; }
.toast[data-kind="error"] { border-color: var(--danger); color: var(--danger); }
.mobile-nav { display: none; }

@media (min-width: 981px) {
  .lesson-pane.is-scrolled::before {
    position: sticky;
    top: -14px;
    z-index: 34;
    display: block;
    height: 44px;
    margin-bottom: -44px;
    background: linear-gradient(to bottom, var(--classroom-middle), transparent);
    pointer-events: none;
    content: '';
  }
  .workspace.is-panel-motion { transition: grid-template-columns 260ms cubic-bezier(.2, .7, .2, 1); }
  .workspace .classroom-sources, .workspace .understanding-pane {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 145ms ease 100ms, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s;
  }
  .workspace .panel-reopen {
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 105ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s 105ms;
  }
  .workspace .panel-collapsed-account {
    display: grid;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-7px);
    transition: opacity 105ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s 105ms;
  }
  .workspace.is-sources-collapsed { grid-template-columns: 44px minmax(0, 1fr) var(--understanding-width); }
  .workspace.is-understanding-collapsed { grid-template-columns: var(--sources-width) minmax(0, 1fr) 44px; }
  .workspace.is-sources-collapsed.is-understanding-collapsed { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .workspace.is-sources-collapsed .panel-resizer-sources,
  .workspace.is-understanding-collapsed .panel-resizer-understanding { display: none; }
  .workspace.is-sources-collapsed .classroom-sources,
  .workspace.is-understanding-collapsed .understanding-pane {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 105ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s 105ms;
  }
  .workspace.is-sources-collapsed .classroom-sources { transform: translateX(-10px); }
  .workspace.is-understanding-collapsed .understanding-pane { transform: translateX(10px); }
  .workspace.is-sources-collapsed .panel-reopen-sources,
  .workspace.is-understanding-collapsed .panel-reopen-understanding {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity 130ms ease 120ms, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s;
  }
  .workspace.is-sources-collapsed .panel-collapsed-account {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 130ms ease 120ms, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s;
  }
}
@media (min-width: 1321px) {
  .top-actions .upload-button { display: none; }
  body.sources-collapsed .top-actions .upload-button { display: inline-flex; }
  body:has(#question-bubble:not([hidden])) .lesson-pane > .section-title-row { min-height: 76px; }
}
@media (max-width: 1320px) {
  .course-heading { max-width: 220px; }
  .workspace { --understanding-width: clamp(350px, 42vw, 560px); }
  .classroom-sources, .workspace.is-sources-collapsed .panel-reopen-sources,
  .workspace .panel-collapsed-account { display: none; }
  .panel-resizer-sources { display: none; }
  .workspace, .workspace.is-sources-collapsed { grid-template-columns: minmax(0, 1fr) var(--understanding-width); }
  .workspace.is-understanding-collapsed,
  .workspace.is-sources-collapsed.is-understanding-collapsed { grid-template-columns: minmax(0, 1fr) 44px; }
}
@media (min-width: 981px) and (max-width: 1320px) {
  body:has(#question-bubble:not([hidden])) .lesson-pane > .section-title-row p { max-width: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace, .workspace .classroom-sources, .workspace .understanding-pane, .workspace .panel-reopen,
  .workspace .panel-collapsed-account { transition: none !important; }
  .question-bubble, .question-bubble * { transition: none !important; animation: none !important; }
}

@media (max-width: 1250px) {
  .topbar { grid-template-columns: auto minmax(150px, 1fr) auto; gap: 2px 20px; }
  .brand { grid-column: 1; grid-row: 1; }
  .course-heading { grid-column: 2; grid-row: 1; }
  .top-actions { grid-column: 3; grid-row: 1; justify-content: flex-end; }
  .session-hint { display: none; }
}
@media (max-width: 980px) {
  .workspace::before { display: none; }
  body:has(.app-shell:not([hidden]) .lesson-player:not([hidden])) { padding-bottom: 80px; }
  .lesson-player {
    position: fixed;
    top: auto;
    bottom: 16px;
    left: 50%;
    z-index: 24;
    width: min(960px, calc(100vw - 32px));
    min-height: 66px;
    padding: 4px 14px;
    border-radius: 12px;
    background: var(--source-action-bg);
    box-shadow: 0 8px 28px #1D322B1A;
    visibility: visible;
    transform: translateX(-50%);
  }
  .auth-content { grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); gap: 40px; }
  .notebook-layout { grid-template-columns: 224px minmax(0, 1fr); }
  .notebook-sidebar { padding-left: 18px; padding-right: 14px; }
  .app-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .workspace { flex: none; grid-template-columns: 1fr; overflow: visible; }
  .workspace.is-sources-collapsed, .workspace.is-understanding-collapsed,
  .workspace.is-sources-collapsed.is-understanding-collapsed { grid-template-columns: 1fr; }
  .panel-resizer { display: none; }
  .panel-toggle, .panel-reopen,
  .workspace.is-sources-collapsed .panel-reopen-sources,
  .workspace.is-understanding-collapsed .panel-reopen-understanding { display: none; }
  .lesson-pane { overflow: visible; }
  .understanding-pane { order: -1; min-height: 470px; overflow: visible; }
  .understanding-pane .transcript-pane, .understanding-pane .question-pane, .understanding-pane .notes-pane { min-height: 410px; }
  .transcript-list { min-height: 345px; max-height: none; overflow: visible; }
  .question-pane { overflow: visible; }
  .session-hint { display: none; }
  .pdf-container { min-height: 390px; }
}
@media (max-width: 480px) {
  .drawing-toolbar__options { width: min(234px, calc(100vw - 142px)); }
  .drawing-toolbar__palette { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
}
@media (max-width: 700px) {
  body { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  body:has(.app-shell:not([hidden]) .lesson-player .player-demo:not([hidden])) { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
  body:has(.auth-view:not([hidden])), body:has(.notebook-view:not([hidden])) { padding-bottom: 0; }
  .auth-header, .notebook-header { min-height: 70px; padding: 12px 16px; }
  .auth-header-actions > span { display: none; }
  .auth-content { display: block; min-height: calc(100dvh - 70px); padding: 46px 20px 54px; }
  .auth-intro h1 { font-size: 32px; }
  .auth-intro > p:last-child { margin-top: 12px; font-size: 15px; }
  .auth-panel { margin-top: 40px; padding: 0; border-left: 0; }
  .auth-modes { margin-top: 24px; }
  .notebook-account { gap: 8px; }
  #account-email { max-width: 40vw; }
  .notebook-layout { display: block; }
  .notebook-layout.is-collapsed .notebook-sidebar { display: none; }
  .notebook-sidebar { position: static; display: block; height: auto; padding: 25px 16px 20px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .notebook-sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
  .notebook-sidebar-top h1 { margin: 0; font-size: 22px; }
  .notebook-sidebar-top .button { width: auto; flex: none; padding: 0 14px; }
  .notebook-search-label { margin-top: 24px; }
  .course-navigation { margin-top: 20px; overflow: visible; }
  .nav-section-heading { padding-left: 0; }
  .course-list { flex-direction: row; gap: 18px; overflow-x: auto; scrollbar-width: thin; }
  .course-list > button, .course-list > a, .course-list .course-row { width: auto; min-height: 43px; flex: none; padding: 8px 1px; border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .course-list > .is-active, .course-list > [aria-current="page"], .course-list .course-row.is-active { border-bottom-color: var(--brand); }
  .notebook-main { padding: 28px 16px 56px; }
  .notebook-main-heading h2 { font-size: 27px; }
  .new-course-controls { align-items: stretch; }
  .new-course-controls .button { padding: 0 12px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 13px 8px; min-height: 0; padding: 14px 16px; }
  .brand { grid-column: 1; grid-row: 1; }
  .course-heading { grid-column: 2; grid-row: 1; }
  .top-actions { grid-column: 1 / -1; grid-row: 2; }
  .lesson-player { top: auto; width: 100%; visibility: visible; transform: none; }
  .lesson-player:has(.player-live:not([hidden])), .lesson-player:has(.player-empty:not([hidden])) { display: none; }
  .lesson-player:has(.player-demo:not([hidden])) {
    position: fixed;
    right: 0;
    bottom: calc(112px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 24;
    width: auto;
    min-height: 72px;
    padding: 2px 12px;
    border-radius: 0;
    background: var(--source-action-bg);
    box-shadow: none;
  }
  .lesson-player .player-demo { grid-template-columns: 40px minmax(0, 1fr) auto 40px; gap: 4px; }
  .lesson-player .player-time { font-size: 11px; }
  .brand-logo { width: 116px; }
  .course-heading { padding-left: 0; border-left: 0; text-align: right; }
  .course-heading-meta { justify-content: flex-end; }
  .course-heading-meta span { display: none; }
  #back-to-notebook-btn { font-size: 13px; }
  .course-heading h1 { max-width: 170px; font-size: 16px; }
  .top-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .top-actions .theme-toggle { justify-self: center; }
  .button { width: 100%; min-height: 44px; padding: 0 2px; font-size: 14px; }
  #desktop-stop-btn, #pause-btn { display: none; }
  .session-strip { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; min-height: 84px; padding: 6px 16px; background: linear-gradient(180deg, var(--source-action-bg) 0%, var(--classroom-middle) 100%); font-size: 14px; box-shadow: 0 12px 18px -18px #1D322B55; }
  .session-live { grid-column: 1; grid-row: 1; min-width: 0; }
  #session-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .caption-reopen-btn { min-height: 32px; padding: 2px 0; font-size: 12px; }
  .session-mode { grid-column: 1; grid-row: 2; font-size: 14px; }
  .session-mode .strip-divider, .session-mode #mode-label { display: none; }
  .save-status { grid-column: 1; grid-row: 3; min-width: 0; margin-left: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
  .session-quick-controls { grid-column: 2; grid-row: 1 / 4; display: flex; align-items: center; gap: 5px; }
  .session-quick-controls button { min-width: 48px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 0; background: transparent; color: var(--brand); font-size: 14px; font-weight: 650; }
  .session-quick-controls button:disabled { opacity: .5; }
  #mobile-stop-btn:not(:disabled) { color: var(--danger); }
  .workspace { display: block; min-height: calc(100dvh - 288px); padding: 22px 16px 32px; scroll-margin-top: 84px; }
  .lesson-pane { padding: 0; background: transparent; }
  .understanding-pane { display: contents; min-height: 0; }
  .floating-caption { padding: 8px 11px 9px; }
  .floating-caption-top { min-height: 40px; }
  .floating-caption-language-trigger { min-height: 36px; }
  .floating-caption.is-compact .floating-caption-language-trigger { max-width: 84px; }
  .floating-caption-language-menu button { min-height: 44px; }
  .floating-caption-pin, .floating-caption-close, .floating-caption-resize { width: 40px; height: 40px; }
  .floating-caption-list > .floating-caption-entry:first-child .floating-caption-en { font-size: 15px; }
  .floating-caption-list > .floating-caption-entry:first-child .floating-caption-zh { font-size: 18px; }
  .understanding-header { display: none; }
  .workspace .understanding-pane [data-panel] { display: none; }
  .workspace [data-panel] { display: none; }
  .workspace [data-panel].is-active { display: block; }
  .understanding-pane .transcript-pane, .understanding-pane .question-pane, .understanding-pane .notes-pane { min-height: 0; padding: 0; }
  .notes-intro { margin-top: 10px; }
  .manual-notes-tools button { min-height: 44px; }
  trix-editor#manual-note-editor { min-height: calc(100dvh - 360px); }
  .understanding-pane .section-title-row { display: flex; }
  .section-title-row { min-height: 0; margin-bottom: 14px; }
  .section-title-row h2 { font-size: 22px; }
  .section-title-row p { font-size: 14px; }
  .question-bubble { max-width: calc(100vw - 24px); }
  .question-bubble-actions button, .question-bubble-close { min-height: 34px; }
  .surface-toolbar { flex-wrap: wrap; gap: 2px 8px; padding: 8px 0; }
  .slide-page-frame { padding-inline: clamp(24px, 6vw, 34px); }
  .page-side-nav { width: 44px; height: 44px; }
  .page-side-nav::before { inset: 4px; }
  .page-side-nav svg { width: 19px; height: 19px; }
  .pdf-container { min-height: 240px; }
  .annotation-area { padding: 18px 0 0; }
  .subsection-heading span { display: none; }
  .transcript-surface { min-height: calc(100dvh - 340px); }
  .transcript-list { min-height: calc(100dvh - 400px); max-height: none; padding: 4px 16px 20px; }
  .transcript-zh { font-size: 18px; }
  .question-card { min-height: 250px; padding: 18px 0 0; }
  .question-pane { padding-top: 0; border-top: 0; }
  .question-context { flex-direction: column; gap: 10px; padding: 0 0 16px; }
  .question-context .button { display: inline-flex; align-self: flex-start; }
  .question-history { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .question-history::-webkit-scrollbar { display: none; }
  .question-history button { flex: none; max-width: 220px; }
  .source-legend { padding: 13px 1px 0; }
  .app-footer { display: none; }
  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 -5px 25px #1D322B0D;
  }
  .mobile-question-action { width: 100%; min-height: 44px; }
  .mobile-tab-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .mobile-tab { min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 650; }
  .mobile-tab.is-active { border-bottom: 2px solid var(--brand); border-radius: 0; background: transparent; color: var(--brand); }
  .unread-dot { display: inline-block; width: 7px; height: 7px; margin: 0 0 2px 3px; border-radius: 50%; background: var(--question); }
  .toast { right: 14px; bottom: calc(116px + env(safe-area-inset-bottom)); left: 14px; max-width: none; }
}
@media (max-width: 410px) {
  .auth-modes { gap: 15px; }
  .new-course-controls { flex-direction: column; }
  .course-heading h1 { max-width: 130px; }
  .toolbar-title small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .drawing-toolbar__rail { transition: none !important; }
  .drawing-toolbar__rail.is-expanded > * { animation: none !important; }
}

/* Course and lesson editing uses one reading surface and restrained rules. */
.notebook-editor-dialog {
  width: min(500px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  padding: 27px 30px 24px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 70px #1D322B33;
}
.notebook-editor-dialog::backdrop { background: #1D322B66; }
.notebook-editor-dialog h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.notebook-editor-description { margin: 8px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.notebook-editor-form label { display: block; margin-top: 18px; font-size: 14px; font-weight: 650; }
.notebook-editor-form input, .notebook-editor-form select {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
.notebook-editor-form select:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.notebook-editor-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.notebook-editor-actions button { min-height: 44px; padding: 0 15px; border-radius: 7px; font-size: 14px; font-weight: 650; }
.notebook-editor-text-button { border: 1px solid transparent; background: transparent; color: var(--brand); }
.notebook-editor-text-button:hover:not(:disabled) { background: var(--brand-soft); }
.notebook-editor-primary-button { border: 1px solid var(--brand-button); background: var(--brand-button); color: var(--on-button); }
.notebook-editor-primary-button:hover:not(:disabled) { background: var(--brand-button-hover); }
.notebook-editor-secondary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 23px; padding-top: 16px; border-top: 1px solid var(--line); }
.notebook-editor-secondary button { min-height: 44px; padding: 0 3px; border-radius: 0; font-size: 14px; font-weight: 650; }
.notebook-editor-secondary small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.notebook-editor-danger-link { border: 0; background: transparent; color: var(--danger); }
.notebook-editor-danger-link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.notebook-editor-danger-link:disabled { color: var(--muted); cursor: not-allowed; }
.notebook-editor-confirm { padding-top: 10px; }
.notebook-editor-confirm h3 { margin: 0 0 14px; font-size: 19px; }
.notebook-editor-delete-list { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14px; line-height: 1.65; }
.notebook-editor-delete-list li + li { margin-top: 6px; }
.notebook-editor-warning { margin: 17px 0 0; color: var(--danger); font-size: 14px; font-weight: 650; }
.notebook-editor-danger-button { border: 1px solid var(--danger-button); background: var(--danger-button); color: var(--on-button); }
.notebook-editor-danger-button:hover:not(:disabled) { background: var(--danger-button-hover); }
.notebook-editor-dialog button:disabled { opacity: .58; }
.notebook-editor-message { min-height: 20px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.notebook-editor-message[data-kind="error"] { color: var(--danger); }

@media (max-width: 700px) {
  .notebook-editor-dialog { padding: 24px 20px 20px; }
  .notebook-editor-actions { justify-content: stretch; }
  .notebook-editor-actions button { flex: 1; }
}

/* Hover previews an action; a long press or sweep explicitly selects passages. */
.floating-caption-entry.is-draggable {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color .16s ease;
}
.floating-caption-entry.is-draggable:hover,
.floating-caption-entry.is-draggable:focus-within {
  background: #B9DFC714;
}
.floating-caption-entry.is-selected,
.floating-caption-entry.is-selected:hover,
.floating-caption-entry.is-selected:focus-within {
  background: #B9DFC72B;
  cursor: grab;
}
.floating-caption-entry.is-selected:active { cursor: grabbing; }
.floating-caption-entry.is-draggable:focus-visible { outline: none; background: #B9DFC72B; }
.floating-caption-drag-segment {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #D5EDDD14;
  color: #D5EDDD;
  cursor: pointer;
  opacity: .74;
  touch-action: none;
  user-select: none;
  transition: opacity .15s ease, background-color .15s ease;
}
.floating-caption-drag-segment svg { display: block; width: 18px; height: 18px; }
.floating-caption-entry:hover .floating-caption-drag-segment,
.floating-caption-entry:focus-within .floating-caption-drag-segment,
.floating-caption-entry.is-selected .floating-caption-drag-segment,
.floating-caption-drag-segment:hover,
.floating-caption-drag-segment:focus-visible { opacity: 1; }
.floating-caption-drag-segment:hover { background: #D5EDDD32; }
.floating-caption-entry.is-selected .floating-caption-drag-segment { background: #B9DFC72A; }
.floating-caption-entry.is-selected .floating-caption-drag-segment:active { cursor: grabbing; }
.floating-caption-drag-segment:focus-visible { outline: 2px solid #B9DFC7; outline-offset: 2px; }

/* Each note is anchored to a percentage point on the rendered PDF sheet. */
.pdf-workspace__sheet.is-drop-target {
  outline: 3px solid #3D9C73;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px #3D9C7330;
}
.page-note-layer { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.page-note {
  --note-color: #1D735B;
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 14px);
  transform: translate(-15px, -50%);
  pointer-events: auto;
}
.page-note[data-color="green"] { --note-color: #1D735B; }
.page-note[data-color="blue"] { --note-color: #316987; }
.page-note[data-color="amber"] { --note-color: #8A5B18; }
.page-note[data-color="rose"] { --note-color: #A2435D; }
.page-note[data-side="left"], .page-note.is-flipped {
  flex-direction: row-reverse;
  transform: translate(calc(-100% + 15px), -50%);
}
.page-note-marker {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--note-color);
  border-radius: 50%;
  background: var(--note-color);
  color: #FFFFFF;
  box-shadow: 0 2px 7px #14271F38;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
}
.page-note[data-variant="outline"] .page-note-marker {
  background: #FFFFFF;
  color: var(--note-color);
}
.page-note-marker { cursor: grab; touch-action: none; }
.page-note-marker:hover { filter: brightness(1.1); box-shadow: 0 3px 10px #14271F55; }
.page-note.is-dragging .page-note-marker { cursor: grabbing; box-shadow: 0 5px 15px #14271F66; }
.page-note-marker:focus-visible, .page-note-text:focus-visible {
  outline: 3px solid var(--note-color);
  outline-offset: 3px;
}
.page-note-text {
  display: block;
  max-width: min(260px, 42vw);
  padding: 6px 9px;
  border: 1px solid #CAD5CC;
  border-left: 3px solid var(--note-color);
  border-radius: 6px;
  background: #FFFFFFF2;
  color: #20382E;
  box-shadow: 0 3px 10px #102D2228;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  cursor: pointer;
}
.page-note-text:hover { background: #F4FBF6; box-shadow: 0 4px 13px #102D2233; }
.page-note[data-side="left"] .page-note-text, .page-note.is-flipped .page-note-text {
  border-left: 1px solid #CAD5CC;
  border-right: 3px solid var(--note-color);
}

/* The editor is portaled to the body so it is never clipped by the PDF page. */
.page-note-popover {
  position: fixed;
  z-index: 70;
  width: min(360px, calc(100vw - 24px));
  max-height: min(78vh, 650px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 46px #10231B33, 0 2px 8px #10231B17;
}
html[data-theme="dark"] .page-note-popover { box-shadow: 0 20px 54px #00000088; }
.page-note-popover__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-note-popover__title { margin: 0; font-size: 16px; font-weight: 720; line-height: 1.35; }
.page-note-popover__close {
  display: grid;
  flex: none;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.page-note-popover__close:hover { background: var(--brand-soft); color: var(--ink); }
.page-note-popover__section + .page-note-popover__section { margin-top: 14px; }
.page-note-popover__label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.page-note-popover__swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.page-note-popover__swatch {
  --swatch-color: #1D735B;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
}
.page-note-popover__swatch[data-color="green"] { --swatch-color: #1D735B; }
.page-note-popover__swatch[data-color="blue"] { --swatch-color: #316987; }
.page-note-popover__swatch[data-color="amber"] { --swatch-color: #8A5B18; }
.page-note-popover__swatch[data-color="rose"] { --swatch-color: #A2435D; }
.page-note-popover__swatch::before { width: 22px; height: 22px; border-radius: 50%; background: var(--swatch-color); content: ''; }
.page-note-popover__swatch:hover { background: var(--brand-soft); }
.page-note-popover__swatch[aria-pressed="true"] { border-color: var(--swatch-color); }
.page-note-popover__segments { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.page-note-popover__segment {
  flex: 1;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}
.page-note-popover__segment:hover { color: var(--ink); }
.page-note-popover__segment[aria-pressed="true"] { border-color: var(--line); background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px #10231B14; }
.page-note-popover__textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  max-height: 240px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}
.page-note-popover__textarea::placeholder { color: var(--placeholder); }
.page-note-popover__actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.page-note-popover__actions button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}
.page-note-popover__actions button:hover:not(:disabled) { background: var(--brand-soft); }
.page-note-popover__actions button[type="submit"], .page-note-popover__actions .is-primary {
  border-color: var(--brand-button);
  background: var(--brand-button);
  color: var(--on-button);
}
.page-note-popover__actions button[type="submit"]:hover:not(:disabled),
.page-note-popover__actions .is-primary:hover:not(:disabled) { background: var(--brand-button-hover); }
.page-note-popover__actions button:disabled { opacity: .5; }
.page-note-popover__status { min-height: 16px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.page-note-popover__status[data-kind="error"] { color: var(--danger); }
.page-note-drag-preview {
  position: fixed;
  z-index: 80;
  max-width: min(270px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid #B9DFC766;
  border-radius: 8px;
  background: #1D3028F0;
  color: #F5F7F5;
  box-shadow: 0 9px 25px #0D201A55;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform: translate(12px, 12px);
}
.page-note-drag-preview.is-over-sheet { border-color: #B9DFC7; background: #1D6047F2; }

@media (hover: none) {
  .floating-caption-drag-segment { opacity: 1; }
}

@media (max-width: 700px) {
  .page-note-marker { width: 27px; height: 27px; font-size: 12px; }
  .page-note { transform: translate(-13.5px, -50%); }
  .page-note[data-side="left"], .page-note.is-flipped { transform: translate(calc(-100% + 13.5px), -50%); }
  .page-note-text { max-width: min(180px, 42vw); padding: 5px 7px; font-size: 11px; }
  .page-note-popover { max-height: min(72dvh, 600px); padding: 14px; }
  .page-note-popover__swatch { width: 38px; height: 38px; }
  .page-note-popover__swatch::before { width: 25px; height: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .floating-caption-entry.is-draggable, .floating-caption-drag-segment { transition: none; }
}

/* Keep classroom controls available as the viewport narrows. */
@media (min-width: 981px) and (max-width: 1320px) {
  .topbar { row-gap: 2px; padding-top: 8px; padding-bottom: 8px; }
  .lesson-player {
    position: relative;
    top: auto;
    left: auto;
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(800px, 100%);
    margin: 0 auto;
    visibility: visible;
    transform: none;
  }
}

@media (min-width: 701px) and (max-width: 980px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; padding: 8px 16px; }
  .brand { grid-column: 1; grid-row: 1; }
  .course-heading { grid-column: 2; grid-row: 1; max-width: none; }
  .top-actions { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
  body:has(.app-shell:not([hidden]) .lesson-player:not([hidden])) .toast { bottom: 96px; }
}

@media (max-width: 1320px) {
  .sources-drawer-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }
  .sources-drawer-trigger:hover { background: var(--brand-soft); }
  .workspace.is-sources-drawer-open::before {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: #10251E66;
    content: '';
  }
  .workspace.is-sources-drawer-open .classroom-sources {
    position: fixed;
    top: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 50;
    display: flex;
    width: min(320px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    box-shadow: 0 20px 70px #10251E45;
  }
  .workspace.is-sources-drawer-open .sources-intro .panel-toggle { display: inline-flex; }
  .workspace.is-sources-drawer-open .source-pages { flex: 0 0 auto; max-height: min(40dvh, 300px); }
}

@media (max-width: 700px) {
  .lesson-pane > .section-title-row { align-items: flex-start; }
  .lesson-pane > .section-title-row > div { min-width: 0; }
  .sources-drawer-trigger { padding: 0 10px; }
  .question-dialog { padding: 18px; }
  .question-dialog-actions { flex-wrap: wrap; }
}

@media (max-width: 700px) and (max-height: 500px) {
  body { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  body:has(.app-shell:not([hidden]) .lesson-player .player-demo:not([hidden])) { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .topbar { gap: 3px 8px; padding: 5px 12px; }
  .brand-logo { width: 96px; }
  .course-heading h1 { max-width: 210px; font-size: 14px; }
  .top-actions { gap: 4px; }
  .top-actions .button { min-height: 40px; }
  .session-strip { min-height: 42px; padding: 2px 12px; }
  .session-mode, .save-status { display: none; }
  .session-quick-controls { grid-row: 1; }
  .session-quick-controls button { min-height: 40px; }
  .workspace { min-height: 0; padding: 12px 12px 20px; }
  .mobile-nav { flex-direction: row; align-items: center; gap: 7px; padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); }
  .mobile-question-action { width: auto; min-height: 44px; flex: none; padding: 0 7px; font-size: 13px; }
  .mobile-tab-row { flex: 1; min-width: 0; gap: 1px; }
  .mobile-tab { min-width: 0; min-height: 44px; font-size: 13px; }
  .lesson-player:has(.player-demo:not([hidden])) { bottom: calc(54px + env(safe-area-inset-bottom)); min-height: 54px; }
  .transcript-surface, .transcript-list { min-height: 180px; }
  .toast { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .drawing-toolbar__rail.is-expanded { max-height: min(var(--rail-open-height, 320px), calc(100dvh - 160px)); overflow-y: auto; }
}

/* On shorter laptop windows, the expanded drawing dock must remain reachable. */
@media (min-width: 981px) and (max-height: 760px) {
  .drawing-toolbar__rail.is-expanded {
    max-height: min(var(--rail-open-height, 320px), 250px, calc(100dvh - 300px));
    overflow-y: auto;
  }
  .drawing-toolbar__options { max-height: min(360px, calc(100dvh - 300px)); overflow-y: auto; }
}

/* Give the original header player a little more air above the timeline. */
@media (min-width: 1321px) {
  .topbar:has(.player-demo:not([hidden])) { min-height: 88px; }
}

@media (min-width: 981px) and (max-width: 1320px) {
  .topbar:has(.player-demo:not([hidden])) .lesson-player { margin-top: 6px; }
}

@media (max-width: 700px) {
  .lesson-player .player-demo { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 2px 0; }
  .lesson-player .player-time { font-size: 12px; }
  .player-demo-controls { gap: 4px; }
  .player-toggle, .player-skip { width: 40px; }
  .player-speed { min-width: 47px; padding: 0 3px; font-size: 12px; }
}

@media (max-width: 700px) and (max-height: 500px) {
  .player-speed-menu { max-height: calc(100dvh - 140px); overflow-y: auto; }
  .player-speed-menu::after { display: none; }
}

/* In-page lesson focus keeps the classroom header while giving the slide the full middle column. */
html.is-slide-fullscreen body { overflow: hidden; padding: 0 !important; }
html.is-slide-fullscreen #classroom-view { height: 100dvh !important; min-height: 0; overflow: hidden; }
html.is-slide-fullscreen #mobile-nav,
html.is-slide-fullscreen #question-bubble { display: none !important; }
html.is-slide-fullscreen #workspace {
  position: relative;
  z-index: auto;
  display: grid !important;
  grid-template-columns: var(--sources-width) minmax(0, 1fr) var(--understanding-width);
  flex: 1 1 0;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 12px;
}
html.is-slide-fullscreen #workspace.is-sources-collapsed {
  grid-template-columns: 44px minmax(0, 1fr) var(--understanding-width);
}
html.is-slide-fullscreen #workspace.is-understanding-collapsed {
  grid-template-columns: var(--sources-width) minmax(0, 1fr) 44px;
}
html.is-slide-fullscreen #workspace.is-sources-collapsed.is-understanding-collapsed {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}
html.is-slide-fullscreen #workspace > .panel-resizer { display: none !important; }
@media (max-width: 1320px) {
  html.is-slide-fullscreen #workspace > .lesson-pane { grid-column: 2; }
  html.is-slide-fullscreen #workspace > .understanding-pane { grid-column: 3; }
  html.is-slide-fullscreen #workspace,
  html.is-slide-fullscreen #workspace.is-sources-collapsed {
    grid-template-columns: 44px minmax(0, 1fr) var(--understanding-width);
  }
  html.is-slide-fullscreen #workspace.is-understanding-collapsed,
  html.is-slide-fullscreen #workspace.is-sources-collapsed.is-understanding-collapsed {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
  html.is-slide-fullscreen #workspace > .panel-reopen-sources {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }
  html.is-slide-fullscreen #workspace.is-sources-drawer-open > .panel-reopen-sources {
    opacity: 0;
    pointer-events: none;
  }
  html.is-slide-fullscreen #workspace > .classroom-sources {
    position: fixed;
    top: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 50;
    display: flex;
    width: min(320px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-14px);
    pointer-events: none;
    box-shadow: 0 20px 70px #10251E45;
    transition: opacity 180ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s 260ms;
  }
  html.is-slide-fullscreen #workspace.is-sources-drawer-open > .classroom-sources {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0s;
  }
}
@media (max-width: 980px) {
  html.is-slide-fullscreen #workspace > .lesson-pane { grid-column: 1; }
  html.is-slide-fullscreen #workspace,
  html.is-slide-fullscreen #workspace.is-sources-collapsed,
  html.is-slide-fullscreen #workspace.is-understanding-collapsed,
  html.is-slide-fullscreen #workspace.is-sources-collapsed.is-understanding-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  html.is-slide-fullscreen #workspace > .panel-collapsed-account { display: none; }
  html.is-slide-fullscreen #workspace.is-understanding-collapsed > .panel-reopen-understanding {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }
  html.is-slide-fullscreen #workspace > .understanding-pane {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: flex;
    width: min(420px, calc(100vw - 24px));
    height: auto;
    overflow: auto;
    box-shadow: 0 20px 70px #10251E45;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    transition: opacity 180ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s;
  }
  html.is-slide-fullscreen #workspace.is-understanding-collapsed > .understanding-pane {
    opacity: 0;
    visibility: hidden;
    transform: translateX(14px);
    pointer-events: none;
    transition: opacity 150ms ease, transform 260ms cubic-bezier(.2, .7, .2, 1), visibility 0s 260ms;
  }
  html.is-slide-fullscreen #workspace .understanding-header { display: block; }
  html.is-slide-fullscreen #workspace .understanding-header .panel-toggle { display: inline-flex; }
  html.is-slide-fullscreen #workspace .understanding-pane [data-panel].is-understanding-active { display: flex; }
}
html.is-slide-fullscreen #workspace .lesson-pane {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px calc(clamp(100px, 17dvh, 154px) + 28px);
}
html.is-slide-fullscreen #workspace .lesson-pane > .section-title-row,
html.is-slide-fullscreen #workspace .annotation-area,
html.is-slide-fullscreen #workspace .source-legend { display: none !important; }
html.is-slide-fullscreen #workspace .lesson-pane > .slide-surface {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
}
html.is-slide-fullscreen #workspace .surface-toolbar {
  display: none;
}
.slide-focus-toolbar { display: none; }
.slide-focus-toolbar[hidden] { display: none !important; }
html.is-slide-fullscreen #workspace .slide-focus-toolbar {
  position: absolute;
  z-index: 38;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  padding: 12px 10px 2px;
  border-radius: 12px 12px 0 0;
  background: #F8F7F3;
  transform: translateX(-50%);
}
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar {
  position: relative;
  top: auto;
  z-index: 40;
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  height: 42px;
  align-self: center;
  overflow: visible;
}
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__dock {
  position: relative;
  top: auto;
  left: 0 !important;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: auto;
  max-width: 100%;
}
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__toggle { display: none; }
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__rail.is-expanded {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;
  max-width: min(100%, calc(100vw - 76px));
  max-height: none !important;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__rail.is-expanded > * { flex: none; animation: none; }
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__tool { color: #536159; }
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__tool:hover,
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__tool.is-selected,
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__current-color:hover { background: #DDEBE2; color: #235E4D; }
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__flyout {
  flex-direction: row;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 3px;
  border-color: #DFE6DF;
  border-radius: 10px;
  background: #F8F7F3;
  box-shadow: 0 5px 18px #14241B22;
}
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__subtool { width: 36px; height: 36px; color: #536159; }
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__subtool:hover,
html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__subtool.is-selected { background: #DDEBE2; color: #235E4D; }
html.is-slide-fullscreen #workspace .slide-page-frame {
  display: flex;
  flex: 1 1 0;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 58px clamp(28px, 3vw, 48px) 0;
}
html.is-slide-fullscreen #workspace .pdf-container { flex: 1 1 0; width: 100%; height: auto; min-height: 0; }
html.is-slide-fullscreen #workspace .pdf-workspace { height: 100% !important; }
html.is-slide-fullscreen #workspace .pdf-workspace__notice { display: none !important; }
html.is-slide-fullscreen #workspace .pdf-workspace__stage {
  display: flex;
  flex: 1 1 0 !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0 !important;
}
html.is-slide-fullscreen #workspace .pdf-workspace__sheet { flex: none; border-radius: 0 0 12px 12px; }
html.is-slide-fullscreen .slide-fullscreen-toggle__expand { display: none; }
html.is-slide-fullscreen .slide-fullscreen-toggle__shrink { display: block; }
html.is-slide-fullscreen #floating-caption { z-index: 50; }
html.is-slide-fullscreen #floating-caption .floating-caption-top { cursor: default; }
html.is-slide-fullscreen #floating-caption .floating-caption-pin,
html.is-slide-fullscreen #floating-caption .floating-caption-resize { display: none; }

@media (max-width: 700px) {
  html.is-slide-fullscreen #workspace .lesson-pane { padding-right: 8px; padding-left: 8px; }
  html.is-slide-fullscreen #workspace .slide-page-frame { padding-right: 25px; padding-left: 25px; }
}

@media (max-width: 980px) {
  html.is-slide-fullscreen .topbar #lesson-player:has(.player-demo:not([hidden])) {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    grid-column: 1 / -1;
    grid-row: 3;
    width: min(800px, 100%);
    min-height: 56px;
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }
}

@media (max-width: 480px) {
  html.is-slide-fullscreen #workspace .slide-focus-toolbar { padding-right: 2px; padding-left: 2px; }
  html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__tool,
  html.is-slide-fullscreen #workspace .slide-focus-toolbar .drawing-toolbar__current-color { width: 34px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html.is-slide-fullscreen #workspace > .classroom-sources,
  html.is-slide-fullscreen #workspace > .understanding-pane { transition: none !important; }
}
