:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-2: #0c0c0f;
  --surface: rgba(20, 20, 24, 0.86);
  --surface-soft: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --muted: #b7b7bd;
  --muted-2: #7f8088;
  --red: #e50914;
  --red-2: #b00610;
  --blue: #02a9ff;
  --green: #23d18b;
  --amber: #f0b85b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.64);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(96, 0, 8, 0.48), transparent 340px),
    linear-gradient(180deg, #050505 0%, #09090b 42%, #050505 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) minmax(520px, 0.9fr);
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 12px 44px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.62) 72%, transparent);
}

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

.brand h1,
.brand p,
.course-header h2,
.course-header p,
.video-meta h3,
.video-meta p,
.panel-title h3,
.sidebar-title strong,
.sidebar-title span,
.next-up strong,
.next-up span,
.next-up small,
.shelf-title h4,
.shelf-title p {
  margin: 0;
}

.brand h1 {
  color: var(--red);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.brand p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
}

.brand-mark svg,
button svg,
.search-box svg,
.empty-player svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.stream-nav {
  display: flex;
  min-width: 0;
  gap: 20px;
  align-items: center;
}

.stream-nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.stream-nav a:hover {
  color: #fff;
}

.setup-bar {
  display: grid;
  grid-template-columns: minmax(150px, 0.78fr) minmax(200px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  outline: none;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

input:focus {
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.18);
}

.primary-button,
.secondary-button,
.icon-button,
.shelf-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  min-width: 0;
  border: 0;
  border-radius: 4px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.primary-button {
  padding: 0 18px;
  color: #fff;
  background: var(--red);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f6121d;
  box-shadow: 0 12px 34px rgba(229, 9, 20, 0.28);
}

.primary-button.glow {
  min-width: 132px;
  box-shadow: 0 16px 40px rgba(229, 9, 20, 0.28);
}

.secondary-button {
  padding: 0 14px;
  color: #fff;
  background: rgba(109, 109, 110, 0.62);
}

.secondary-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.shelf-play:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.28);
}

.icon-button,
.shelf-play {
  width: 38px;
  color: #fff;
  background: rgba(109, 109, 110, 0.56);
}

.icon-button.danger {
  color: #fff;
  background: rgba(229, 9, 20, 0.58);
}

.workspace {
  display: block;
  min-height: 100vh;
}

.content {
  min-width: 0;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: clamp(24px, 4vw, 62px);
  align-items: end;
  min-height: 78vh;
  padding: 108px 44px 42px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.98) 0%, rgba(5, 5, 5, 0.90) 30%, rgba(5, 5, 5, 0.36) 72%, rgba(5, 5, 5, 0.82) 100%),
    linear-gradient(180deg, transparent 0%, transparent 62%, #050505 100%),
    repeating-linear-gradient(90deg, #3a0005 0 70px, #170002 70px 140px, #071522 140px 210px);
}

.hero-stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 104px);
}

.hero-copy,
.video-panel {
  position: relative;
  z-index: 1;
}

.course-header {
  max-width: 760px;
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.course-header h2 {
  margin-top: 10px;
  max-width: 760px;
  overflow-wrap: anywhere;
  font-size: clamp(38px, 5.8vw, 82px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.92;
  text-shadow: 0 4px 38px rgba(0, 0, 0, 0.86);
}

.course-header p {
  max-width: 680px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.45;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.stat-card {
  min-width: 108px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.stat-card span {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.stat-card.accent {
  border-color: rgba(35, 209, 139, 0.44);
}

.video-panel {
  overflow: hidden;
  align-self: center;
  background: rgba(9, 9, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.player-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, #250006, #09131e 48%, #070707);
}

.player-wrap::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 -110px 140px rgba(0, 0, 0, 0.46);
}

video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.empty-player {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 12px;
  place-content: center;
  color: rgba(255, 255, 255, 0.84);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.34), transparent 46%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 86px),
    linear-gradient(135deg, #160003, #09131e);
}

.empty-player svg {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  color: #fff;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.64));
}

.empty-player.hidden,
video.hidden {
  display: none;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 15px 16px 0;
}

.video-meta h3 {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(19px, 1.8vw, 28px);
  line-height: 1.1;
}

.video-meta p {
  color: var(--muted);
}

.video-actions,
.transport-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.progress-strip {
  padding: 13px 16px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.20);
  border-radius: 999px;
}

#progressFill {
  width: 0;
  height: 100%;
  background: var(--red);
}

.transport-row {
  align-items: center;
  padding: 15px 16px 16px;
}

.next-up {
  flex: 1;
  min-width: 220px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.next-up span,
.next-up small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.next-up strong {
  display: block;
  margin: 3px 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.lesson-panel,
.sidebar {
  position: relative;
  z-index: 2;
  padding: 0 44px;
}

.stream-tabs {
  display: flex;
  gap: 24px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  margin: 0 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.stream-tabs button {
  min-height: 46px;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.stream-tabs button.active {
  color: #fff;
  border-bottom-color: var(--red);
}

.panel-title,
.sidebar-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.panel-title.compact {
  margin-top: 30px;
}

.panel-title h3,
.sidebar-title span {
  font-size: 20px;
  font-weight: 900;
}

.panel-title span {
  min-width: 34px;
  color: rgba(255, 255, 255, 0.58);
  text-align: right;
  font-size: 13px;
  font-weight: 900;
}

.lesson-list {
  display: grid;
  gap: 34px;
  min-width: 0;
}

.lesson-shelf {
  min-width: 0;
}

.shelf-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.shelf-title {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.lesson-index {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 950;
}

.lesson-shelf.active .lesson-index {
  background: var(--red);
}

.shelf-title h4 {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.08;
}

.shelf-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lesson-shelf > .mini-progress {
  max-width: 420px;
  margin: 0 0 12px 46px;
}

.shelf-row,
.video-list,
.course-list {
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
  scrollbar-width: thin;
}

.shelf-row {
  display: flex;
  gap: 9px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 6px 2px 26px;
  scroll-padding-left: 2px;
  scroll-snap-type: x proximity;
}

.course-item,
.video-item,
.shelf-card {
  position: relative;
  color: var(--text);
  text-align: left;
  background: #181818;
  border: 0;
  border-radius: 4px;
}

.shelf-card {
  display: grid;
  flex: 0 0 clamp(238px, 22vw, 324px);
  grid-template-rows: auto 1fr auto;
  min-height: 238px;
  padding: 0;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.shelf-card:hover,
.shelf-card.active {
  z-index: 3;
  transform: scale(1.055);
  background: #242424;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.66);
}

.shelf-card.done .thumb-state,
.video-badge.done {
  color: #03140d;
  background: var(--green);
}

.shelf-card.missing .thumb-state,
.video-badge.missing {
  color: #221504;
  background: var(--amber);
}

.shelf-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.92), rgba(176, 6, 16, 0.72) 48%, rgba(2, 169, 255, 0.48)),
    linear-gradient(180deg, #2d0307, #111);
}

.shelf-card:nth-child(3n + 2) .shelf-thumb {
  background:
    linear-gradient(135deg, rgba(2, 169, 255, 0.76), rgba(28, 31, 74, 0.88) 54%, rgba(229, 9, 20, 0.62)),
    #101010;
}

.shelf-card:nth-child(3n) .shelf-thumb {
  background:
    linear-gradient(135deg, rgba(28, 28, 32, 0.96), rgba(229, 9, 20, 0.74) 58%, rgba(35, 209, 139, 0.38)),
    #101010;
}

.thumb-scan {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.62)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 72px);
}

.episode-number,
.thumb-code,
.thumb-state,
.thumb-play {
  position: absolute;
  z-index: 1;
}

.episode-number {
  left: 12px;
  bottom: 4px;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(48px, 5vw, 74px);
  font-weight: 950;
  line-height: 0.88;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.72);
}

.thumb-code {
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.48);
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.thumb-play {
  left: 50%;
  top: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.thumb-state {
  right: 10px;
  bottom: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.shelf-copy {
  display: block;
  min-width: 0;
  padding: 12px 12px 10px;
}

.shelf-copy strong {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shelf-copy span {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.mini-progress,
.card-progress {
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.course-item .mini-progress {
  margin-top: 10px;
}

.mini-progress div,
.card-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
}

.shelf-card .card-progress {
  margin: 0 12px 12px;
}

.video-list {
  display: flex;
  gap: 9px;
  min-width: 0;
  overflow-x: auto;
  padding: 6px 2px 34px;
}

.video-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: clamp(240px, 24vw, 340px);
  flex: 0 0 auto;
  min-height: 82px;
  padding: 12px;
  overflow: hidden;
  transition: transform 150ms ease, background 150ms ease;
}

.video-item:hover,
.video-item.active {
  transform: translateY(-2px);
  background: #242424;
}

.video-copy {
  min-width: 0;
}

.video-code {
  display: block;
  color: var(--red) !important;
  font-size: 10px !important;
  font-weight: 950;
  text-transform: uppercase;
}

.video-copy strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.video-copy span:last-child {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.video-badge {
  min-width: 58px;
  padding: 5px 8px;
  color: #fff;
  text-align: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.video-badge.started {
  color: #fff;
  background: var(--red);
}

.sidebar {
  padding-bottom: 56px;
}

.sidebar-title {
  margin-top: 4px;
}

.sidebar-title span {
  color: #fff;
}

.sidebar-title strong {
  color: var(--red);
  font-size: 28px;
  line-height: 1;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 8px;
  color: rgba(255, 255, 255, 0.58);
}

.search-box input {
  padding-left: 36px;
}

.segment-control {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.segment {
  min-height: 34px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.segment.active {
  color: #fff;
  background: var(--red);
}

.course-list {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding: 6px 2px 28px;
}

.course-item {
  display: grid;
  flex: 0 0 clamp(230px, 20vw, 306px);
  padding: 0;
  overflow: hidden;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.course-item:hover,
.course-item.active {
  z-index: 2;
  transform: scale(1.045);
  background: #242424;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.56);
}

.course-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.95), rgba(32, 32, 38, 0.72) 58%, rgba(2, 169, 255, 0.42)),
    #121212;
}

.course-item:nth-child(2n) .course-art {
  background:
    linear-gradient(135deg, rgba(2, 169, 255, 0.78), rgba(24, 24, 28, 0.80) 56%, rgba(229, 9, 20, 0.62)),
    #121212;
}

.course-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.70)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 74px);
}

.course-rank {
  position: absolute;
  left: 12px;
  bottom: 2px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.96);
  font-size: 64px;
  font-weight: 950;
  line-height: 0.88;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.72);
}

.course-kicker {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 1;
  max-width: calc(100% - 24px);
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.course-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
}

.course-item strong {
  display: block;
  min-height: 42px;
  padding: 11px 12px 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.24;
}

.course-item > span:not(.course-art),
.course-item small {
  display: block;
  padding: 0 12px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.course-item small {
  padding-bottom: 12px;
}

.course-item .mini-progress {
  margin-left: 12px;
  margin-right: 12px;
}

.status-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(460px, calc(100vw - 36px));
  padding: 12px 14px;
  color: var(--text);
  background: #181818;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.status-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.20);
  border-radius: 4px;
}

.shelf-empty {
  flex: 0 0 min(360px, 80vw);
}

@media (max-width: 1240px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .setup-bar {
    grid-column: 1 / -1;
  }

  .hero-stage {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 142px;
  }

  .video-panel {
    align-self: stretch;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: sticky;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.94);
  }

  .stream-nav {
    overflow-x: auto;
  }

  .setup-bar,
  .library-controls {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: auto;
    padding: 28px 16px 32px;
  }

  .lesson-panel,
  .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .course-header h2 {
    font-size: 42px;
  }

  .video-meta,
  .transport-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .header-actions .icon-button {
    flex: 1;
  }

  .shelf-card,
  .course-item {
    flex-basis: 78vw;
  }

  .video-item {
    width: 82vw;
    grid-template-columns: 1fr;
  }

  .lesson-shelf > .mini-progress {
    margin-left: 0;
  }
}
