:root {
  --bg-0: #0b0e14;
  --bg-1: #111621;
  --bg-2: #171e2c;
  --bg-3: #1f293d;
  --border: #28344d;
  --text-0: #f3f6fc;
  --text-1: #c2cde0;
  --text-2: #8695b0;
  --gold: #f5b041;
  --gold-hover: #f8c471;
  --gold-dim: rgba(245, 176, 65, 0.14);
  --green: #2ecc71;
  --green-dim: rgba(46, 204, 113, 0.15);
  --blue: #5dade2;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* TOPBAR */
.topbar {
  height: 64px;
  min-height: 64px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 16px;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.brand-badge {
  background: linear-gradient(135deg, #f5b041, #d68910);
  color: #0b0e14;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
}

.brand-titles h1 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-2);
}

.topbar-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-0);
  padding: 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.nav-pill {
  background: transparent;
  color: var(--text-1);
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-pill:hover {
  color: var(--text-0);
  background: var(--bg-2);
}

.nav-pill.active {
  background: var(--gold-dim);
  color: var(--gold);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-box input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--gold);
}

.search-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  width: 460px;
  max-height: 440px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  z-index: 100;
  padding: 6px;
}

.search-item {
  padding: 9px 11px;
  border-radius: 7px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-item:hover {
  background: var(--bg-3);
}

.search-item-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 2px;
}

.search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}

.search-item-snip {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.global-progress-chip {
  min-width: 140px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
}

.gp-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-1);
  margin-bottom: 4px;
}

.gp-bar {
  height: 5px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}

.gp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 0.3s ease;
}

/* BUTTONS */
.icon-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.btn-gold {
  background: var(--gold);
  color: #0b0e14;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-outline {
  background: var(--bg-2);
  color: var(--text-0);
  border: 1px solid var(--border);
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover {
  border-color: var(--gold);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn-check {
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-check.done {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green);
}

/* WORKSPACE */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 330px;
  min-width: 330px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-left 0.2s ease;
}

.sidebar.collapsed {
  margin-left: -330px;
}

.resume-card {
  margin: 12px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(245, 176, 65, 0.16), rgba(23, 30, 44, 0.95));
  border: 1px solid rgba(245, 176, 65, 0.45);
  border-radius: 10px;
}

.resume-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.resume-title {
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 2px;
}

.resume-meta {
  font-size: 11px;
  color: var(--text-1);
  margin-bottom: 8px;
}

.sidebar-filter {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-filter input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.sections-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sec-block {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-2);
}

.sec-header {
  width: 100%;
  background: var(--bg-2);
  color: var(--text-0);
  border: none;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sec-header:hover {
  background: var(--bg-3);
}

.sec-title {
  font-size: 12.5px;
  font-weight: 700;
}

.sec-count {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.sec-lessons {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}

.lesson-row {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.lesson-row.active {
  background: var(--gold-dim);
  border-left: 3px solid var(--gold);
}

.lesson-row-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.status-dot {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-2);
}

.status-dot.done {
  color: var(--green);
}

.lesson-row-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-0);
  flex: 1;
}

.lesson-row-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  padding-left: 20px;
}

.mini-prog {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  margin-left: 20px;
  overflow: hidden;
}

.mini-prog-fill {
  height: 100%;
  background: var(--gold);
}

/* MAIN STAGE */
.main-stage {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 48px;
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.week-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 5px;
}

.lesson-header h2 {
  font-size: 21px;
  font-weight: 800;
}

.lesson-subtitle {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.lesson-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* VIDEO + TRANSCRIPT GRID */
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stage-grid.cinema {
  grid-template-columns: 1fr;
}

.video-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-wrapper {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
}

.video-wrapper:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #000;
}

/* TARJA COMPACTA DISCRETA QUE COBRE APENAS A ÁREA CENTRAL DA LEGENDA ANTIGA */
.sub-mask-bar {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 1.5%;
  min-height: 13.8%;
  background: rgba(8, 10, 15, 0.96);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  text-align: center;
  pointer-events: none;
  z-index: 6;
  transition: bottom 0.16s ease, opacity 0.16s ease;
}

/* Quando o mouse mexe sobre o vídeo, sobe só um pouco para liberar a barra de play/tempo */
.video-wrapper.controls-awake .sub-mask-bar {
  bottom: 44px;
  min-height: 10.8%;
}

.sub-mask-text {
  color: #ffffff;
  font-size: calc(clamp(18px, 1.68vw, 24px) * var(--sub-scale, 1));
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  max-width: 98%;
}

.video-wrapper:fullscreen .sub-mask-text {
  font-size: calc(clamp(25px, 2.25vw, 36px) * var(--sub-scale, 1));
}

/* OVERLAY DE PRÓXIMA AULA AUTOMÁTICA */
.autonext-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 18, 0.84);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  padding: 20px;
}

.autonext-card {
  background: var(--bg-2);
  border: 1px solid rgba(245, 176, 65, 0.55);
  border-radius: 14px;
  padding: 22px 26px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  text-align: center;
}

.autonext-badge {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}

.autonext-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 14px;
  line-height: 1.35;
}

.autonext-bar {
  height: 5px;
  background: var(--bg-0);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}

.autonext-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 0.25s linear;
}

.autonext-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ctrl-chip.sub-toggle-on {
  border-color: rgba(245, 176, 65, 0.65);
  color: var(--gold);
  background: var(--gold-dim);
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 20, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 10px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.resume-toast {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(11, 14, 20, 0.88);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.player-toolbar {
  padding: 10px 14px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-label {
  font-size: 12px;
  color: var(--text-2);
}

.sep {
  color: var(--border);
  margin: 0 4px;
}

.ctrl-chip, .speed-btn {
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ctrl-chip:hover, .speed-btn:hover {
  border-color: var(--gold);
  color: var(--text-0);
}

.speed-btn.active {
  background: var(--gold);
  color: #0b0e14;
  border-color: var(--gold);
}

.save-pill {
  font-size: 11.5px;
  color: var(--green);
  margin-right: 6px;
}

/* TRANSCRIPT RAIL */
.transcript-rail {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 540px;
  overflow: hidden;
}

.rail-header {
  padding: 11px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rail-header strong {
  display: block;
  font-size: 13px;
}

.rail-sub {
  font-size: 11px;
  color: var(--text-2);
}

.autoscroll-toggle {
  font-size: 11.5px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.rail-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.rail-search input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.t-seg {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}

.t-seg:hover {
  background: var(--bg-2);
}

.t-seg.active {
  background: var(--gold-dim);
  border-left-color: var(--gold);
}

.t-time {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-right: 6px;
}

.t-text {
  font-size: 13px;
  color: var(--text-1);
}

.t-seg.active .t-text {
  color: var(--text-0);
}

/* STUDY TABS */
.study-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.study-tabs {
  display: flex;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 6px;
}

.study-tab {
  background: transparent;
  color: var(--text-2);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}

.study-tab:hover {
  color: var(--text-0);
}

.study-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.badge-cnt {
  background: var(--bg-3);
  color: var(--text-1);
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
}

.study-tab-body {
  display: none;
  padding: 20px;
}

.study-tab-body.active {
  display: block;
}

.panel-intro {
  margin-bottom: 16px;
}

.panel-intro h3 {
  font-size: 16px;
}

.panel-intro p {
  font-size: 13px;
  color: var(--text-2);
}

.exercises-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ex-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.ex-card.done {
  border-color: rgba(46, 204, 113, 0.5);
}

.ex-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.ex-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
}

.ex-prompt {
  font-size: 13.5px;
  color: var(--text-1);
  margin-bottom: 10px;
  white-space: pre-line;
}

.ex-tip {
  font-size: 12px;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 8px 11px;
  border-radius: 7px;
  margin-bottom: 10px;
}

.ex-textarea {
  width: 100%;
  min-height: 115px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
}

.ex-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.ex-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-2);
}

/* OVERVIEW & NOTES */
.overview-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.overview-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.info-card h3 {
  font-size: 14.5px;
  margin-bottom: 10px;
}

.body-copy {
  font-size: 13.5px;
  color: var(--text-1);
  white-space: pre-line;
}

.bullet-list {
  padding-left: 18px;
  color: var(--text-1);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-chip {
  background: var(--bg-3);
  color: var(--text-0);
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 12px;
}

.muted-sm {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.note-composer textarea {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
}

.note-composer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.time-pill {
  font-family: monospace;
  font-size: 12px;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 4px 9px;
  border-radius: 6px;
}

.notes-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-item {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.note-jump {
  color: var(--gold);
  font-family: monospace;
  font-weight: 700;
  cursor: pointer;
  margin-right: 6px;
}

.note-del {
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
}

/* FILES GRID */
.files-grid, .lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.file-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.file-card h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.file-card p {
  font-size: 12.5px;
  color: var(--text-2);
}

/* FULL PAGE VIEWS (WORKBOOK & LIBRARY) */
.page-view {
  flex: 1;
  overflow-y: auto;
  padding: 26px 32px 60px;
}

.page-container {
  max-width: 1240px;
  margin: 0 auto;
}

.page-hero {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.stat-big {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-right: 14px;
}

.lib-section {
  margin-bottom: 30px;
}

.lib-section h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.lib-section > p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-dialog {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 92vw;
  max-width: 1120px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  background: #fff;
}

/* MARKDOWN RENDERED STYLES */
.md-content h1, .md-content h2, .md-content h3, .md-content h4 {
  color: var(--text-0);
  margin: 20px 0 10px;
}

.md-content p, .md-content li {
  color: var(--text-1);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.md-content ul, .md-content ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.md-content code {
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.md-content pre {
  background: var(--bg-0);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.md-content blockquote {
  border-left: 3px solid var(--gold);
  background: var(--bg-2);
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
}

/* DEDICATED LESSON PDF DOCK RIGHT BELOW VIDEO */
.lesson-pdf-dock {
  background: var(--bg-1);
  border: 1.5px solid rgba(245, 176, 65, 0.45);
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.lesson-pdf-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: linear-gradient(90deg, rgba(245, 176, 65, 0.14) 0%, var(--bg-2) 60%);
  border-bottom: 1px solid var(--border);
}

.lesson-pdf-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 240px;
  flex: 1;
}

.lesson-pdf-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}

.lesson-pdf-titles h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  margin: 0;
}

.lesson-pdf-switchers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pdf-mode-pill {
  background: var(--bg-0);
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pdf-mode-pill:hover {
  border-color: var(--gold);
  color: var(--text-0);
}

.pdf-mode-pill.active {
  background: var(--gold);
  color: #0b0e14;
  border-color: var(--gold);
}

.lesson-pdf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson-pdf-frame-wrap {
  width: 100%;
  height: 760px;
  background: #1e2430;
}

.lesson-pdf-frame-wrap.collapsed {
  display: none;
}

.lesson-pdf-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #ffffff;
}

@media (max-width: 1100px) {
  .stage-grid, .overview-columns {
    grid-template-columns: 1fr;
  }
}
