.player-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-actions .secondary-button {
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
}

@media (max-width: 560px) {
  .player-tools { align-items: stretch; flex-direction: column; }
  .player-actions { justify-content: space-between; }
  .player-tools > span { text-align: left; }
}

.video-local-diagnostics {
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: #f4f6f8;
  color: #4f5965;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.lesson-video {
  border-radius: 14px;
  background: #0d1520;
  box-shadow: 0 8px 24px rgba(15, 29, 46, 0.12);
}

.lesson-unmute-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 8px 0 2px;
  padding: 9px 14px;
  border: 1px solid #b6d3f7;
  border-radius: 11px;
  background: linear-gradient(90deg, #ecf5ff 0%, #f5f9ff 100%);
  color: #164d8e;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.lesson-unmute-bar:hover {
  border-color: #1874dc;
  background: #e3f0ff;
}

.lesson-unmute-bar span:last-child {
  padding: 3px 10px;
  border-radius: 999px;
  background: #1874dc;
  color: #fff;
  font-size: 12px;
}

.lesson-chapter-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #e2e9f2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 44, 74, 0.04);
}

.lesson-chapters-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.lesson-chapters-heading strong {
  font-size: 15px;
  color: #162436;
}

.lesson-chapters-heading small {
  font-size: 12px;
  color: #4b6584;
  background: #f1f6fd;
  padding: 3px 10px;
  border-radius: 999px;
}

.lesson-chapter-list {
  display: grid;
  gap: 8px;
}

.lesson-chapter-list > button {
  appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #e3eaf3;
  border-radius: 12px;
  background: #fafcfe;
  color: #1c2b3d;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.lesson-chapter-list > button > span:first-child {
  min-width: 28px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eaf1fb;
  color: #235da4;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lesson-chapter-list > button > strong {
  font-size: 14px;
  font-weight: 620;
  color: #182738;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-chapter-list > button > small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #607286;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lesson-chapter-list > button:hover:not(:disabled) {
  border-color: #7ab0f0;
  background: #f1f7ff;
  box-shadow: 0 4px 12px rgba(24, 116, 220, 0.09);
  transform: translateY(-1px);
}

.lesson-chapter-list > button.active {
  border-color: #1874dc;
  background: linear-gradient(90deg, #edf5ff 0%, #f7fbff 100%);
  box-shadow: 0 4px 14px rgba(24, 116, 220, 0.12);
}

.lesson-chapter-list > button.active > span:first-child {
  background: #1874dc;
  color: #fff;
}

.lesson-chapter-list > button.active > strong {
  color: #10498e;
  font-weight: 680;
}

.chapter-state-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dceafe;
  color: #1756a3;
  font-size: 11px;
  font-weight: 600;
}

.lesson-chapter-list > button.is-playing .chapter-state-pill {
  background: #1874dc;
  color: #fff;
}

.lesson-chapter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.lesson-active-chapter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 10px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid #d7e6f8;
  background: #f3f8ff;
  color: #194d8c;
  font-size: 12.5px;
  line-height: 1.45;
}

.lesson-active-chapter-banner strong {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-active-chapter-banner span {
  color: #55708f;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lesson-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.lesson-quick-chip {
  appearance: none;
  border: 1px solid #d5e2f2;
  border-radius: 999px;
  padding: 5px 11px;
  background: #f8fbff;
  color: #215594;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease;
}

.lesson-quick-chip:hover:not(:disabled) {
  border-color: #1874dc;
  background: #eaf3ff;
}

.lesson-quick-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lesson-ask-form {
  display: grid;
  gap: 10px;
}

.lesson-ask-form textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  font: inherit;
  line-height: 1.6;
}

.lesson-ask-form .primary-button {
  width: 100%;
  margin: 0;
}

.lesson-chat-status {
  display: block;
  color: #5b6978;
  font-size: 12px;
  line-height: 1.65;
}

.lesson-chat-log {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  margin: 10px 0;
}

.lesson-chat-message {
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.lesson-chat-message.user {
  background: #eef4fb;
}

.lesson-chat-message.assistant {
  background: #f6f7f9;
}

.lesson-chat-message.error {
  background: #fff3f1;
  color: #8b3b32;
}

.lesson-chat-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lesson-chat-citation {
  min-height: 32px;
  border: 1px solid #c9d8e8;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  color: #1769aa;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.lesson-chat-citation:focus-visible {
  outline: 2px solid #1769aa;
  outline-offset: 2px;
}

.course-auto-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0f6ff;
  color: #1e5799;
  font-size: 12px;
}

.chapter-inline-editor {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #dce6f2;
  border-radius: 12px;
  background: #fafcff;
}

.chapter-inline-rows {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.chapter-inline-row {
  display: grid;
  grid-template-columns: 28px minmax(140px, 1fr) 92px 92px auto;
  align-items: center;
  gap: 8px;
}

.chapter-inline-row input {
  padding: 7px 9px;
  border: 1px solid #cfdbe9;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

.chapter-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 680px) {
  .chapter-inline-row {
    grid-template-columns: 26px 1fr 1fr;
  }
  .chapter-inline-row input[name="title"] {
    grid-column: 2 / -1;
  }
}

/* Chapter titles read like a contents list, not a stack of cards. */
.course-player-page .lesson-chapter-list {
  gap: 0;
}
.course-player-page .lesson-chapter-list > button[data-chapter] {
  grid-template-columns: minmax(0, 1fr);
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-inline-start: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.course-player-page .lesson-chapter-list > button[data-chapter] + button[data-chapter] {
  border-top: 1px solid #edf0f3;
}
.course-player-page .lesson-chapter-list > button[data-chapter]:hover:not(:disabled) {
  background: #f6f8fb;
  box-shadow: none;
  transform: none;
}
.course-player-page .lesson-chapter-list > button[data-chapter].active {
  border-inline-start-color: #3771b3;
  background: #f2f6fb;
}
.course-player-page .lesson-chapter-list > button[data-chapter]:focus-visible {
  outline: 2px solid #1766bf;
  outline-offset: -2px;
}
.course-player-page .lesson-chapter-list > button[data-chapter] > strong {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Calm, shared typography for the course list, player and question panel. */
.course-player-page, .course-list-page {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: #172438;
}
.course-player-page .course-title-row h1,
.course-list-heading h1 {
  font-size: clamp(23px, 2.1vw, 33px);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.025em;
}
.course-player-page .lesson-chapters-heading > strong,
.course-player-page .lesson-question > summary {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}
.course-player-page .lesson-chapters-heading > small {
  font-size: 12px;
  font-weight: 500;
}
.course-player-page .lesson-chapter-list > button[data-chapter] > strong {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  color: #233248;
}
.course-player-page .lesson-chapter-list > button[data-chapter].active > strong {
  color: #225889;
  font-weight: 400;
}
.course-player-page .lesson-ask-form textarea,
.course-player-page .lesson-chat-log {
  font: inherit;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .course-player-page .course-title-row h1, .course-list-heading h1 { font-size: 24px; }
  .course-player-page .lesson-ask-form textarea { font-size: 16px; }
}
