@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #070a0f;
  --surface: #0d1118;
  --surface-raised: #121822;
  --surface-soft: #171f2b;
  --line: #232d3b;
  --line-bright: #334257;
  --text: #f5f7fb;
  --muted: #9ba8b9;
  --dim: #758398;
  --blue: #4a9eff;
  --blue-hi: #75b6ff;
  --blue-soft: #142b47;
  --magenta: #ff0099;
  --green: #42d392;
  --amber: #f4b942;
  --body-glow: rgba(74, 158, 255, .09);
  --topbar-bg: rgba(7, 10, 15, .9);
  --sidebar-bg: #090d13;
  --content-bg: rgba(13, 17, 24, .78);
  --planned-bg: linear-gradient(145deg, #0c121c, #080b11);
  --accent-border: #244e79;
  --info-border: #243c57;
  --meta-bg: rgba(255, 255, 255, .025);
  --button-ink: #07101d;
  --success-ink: #07130f;
  --sidebar-width: 342px;
  --topbar-height: 72px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .28);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-raised: #eef3f8;
  --surface-soft: #e6edf5;
  --line: #d5dee9;
  --line-bright: #aebdce;
  --text: #172033;
  --muted: #4f6075;
  --dim: #596b82;
  --blue: #176fc1;
  --blue-hi: #125c9f;
  --blue-soft: #e1effd;
  --green: #137a53;
  --amber: #8a5a00;
  --body-glow: rgba(23, 111, 193, .11);
  --topbar-bg: rgba(248, 250, 253, .94);
  --sidebar-bg: #f8fafc;
  --content-bg: rgba(255, 255, 255, .9);
  --planned-bg: linear-gradient(145deg, #ffffff, #edf3f9);
  --accent-border: #78a9d8;
  --info-border: #b8cee3;
  --meta-bg: rgba(23, 111, 193, .045);
  --button-ink: #ffffff;
  --success-ink: #ffffff;
  --shadow: 0 20px 50px rgba(31, 45, 61, .13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% -10%, var(--body-glow), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--button-ink);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.topbar {
  position: fixed;
  z-index: 80;
  inset: 0 0 auto;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(260px, 390px) auto;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin-right: 10px;
}

:root[data-theme="light"] .brand-logo {
  filter: invert(1);
}

.brand-word {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -.04em;
}

.brand-word span {
  color: var(--blue);
  font-weight: 700;
}

.brand-divider {
  width: 1px;
  height: 24px;
  margin: 0 14px;
  background: var(--line-bright);
}

.brand-section {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.top-progress {
  display: grid;
  grid-template-columns: auto 120px;
  align-items: center;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.icon-button.theme-toggle {
  flex: 0 0 auto;
  background: var(--surface-raised);
}

.theme-toggle:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.theme-toggle:focus-visible,
.custom-select-trigger:focus-visible,
.custom-select-option:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.theme-icon-moon,
:root[data-theme="light"] .theme-icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-icon-moon {
  display: block;
}

.top-progress-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.top-progress-copy span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.top-progress-copy strong {
  font-size: 13px;
}

.progress-track,
.watch-track {
  overflow: hidden;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}

.progress-track span,
.watch-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #76c0ff);
  transition: width .25s ease;
}

.continue-button,
.secondary-button,
.complete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.continue-button {
  padding: 0 16px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--button-ink);
  font-size: 13px;
  font-weight: 800;
}

.continue-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.3;
}

.continue-button:hover,
.complete-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.sidebar {
  position: fixed;
  z-index: 70;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  scrollbar-color: var(--line-bright) transparent;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 24px 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-hi);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sidebar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.025em;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  margin: 0 18px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, .12);
}

.search-box svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-left: 13px;
  color: var(--dim);
}

.search-box input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--dim);
}

kbd {
  min-width: 20px;
  padding: 2px 5px;
  border: 1px solid var(--line-bright);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font: 600 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.search-box kbd {
  margin-right: 10px;
}

.library-summary {
  display: flex;
  gap: 18px;
  margin: 0 24px 14px;
  color: var(--dim);
  font-size: 11px;
}

.library-summary strong {
  color: var(--muted);
}

.curriculum {
  padding: 0 10px 36px;
}

.series-block {
  border-top: 1px solid var(--line);
}

.series-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 17px 12px 11px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.series-toggle > span:first-child {
  min-width: 0;
}

.series-toggle small {
  display: block;
  margin-bottom: 2px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.series-toggle strong {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-count {
  color: var(--dim);
  font-size: 11px;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--dim);
  transition: transform .2s ease;
}

.series-block.collapsed .chevron {
  transform: rotate(-90deg);
}

.series-lessons {
  display: grid;
  gap: 3px;
  padding-bottom: 11px;
}

.series-block.collapsed .series-lessons {
  display: none;
}

.lesson-link {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.lesson-link:hover {
  background: var(--surface);
}

.lesson-link.active {
  border-color: var(--accent-border);
  background: var(--blue-soft);
}

.lesson-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
}

.lesson-link.ready .lesson-number {
  border-color: rgba(74, 158, 255, .52);
  color: var(--blue-hi);
}

.lesson-link.complete .lesson-number {
  border-color: var(--green);
  background: var(--green);
  color: var(--success-ink);
  font-size: 0;
}

.lesson-link.complete .lesson-number::after {
  content: "✓";
  font-size: 13px;
  font-weight: 900;
}

.lesson-link-copy {
  min-width: 0;
}

.lesson-link-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-link-copy small {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 10px;
}

.lesson-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-bright);
}

.lesson-link.ready .lesson-state-dot {
  background: var(--blue);
  box-shadow: 0 0 9px rgba(74, 158, 255, .55);
}

.lesson-link.complete .lesson-state-dot {
  background: var(--green);
  box-shadow: none;
}

.empty-search {
  padding: 28px 16px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.lesson-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 42px) clamp(28px, 4.2vw, 72px) 32px;
  outline: none;
}

.lesson-content > * {
  width: min(1180px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.lesson-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 25px;
}

.lesson-heading {
  max-width: 820px;
}

.lesson-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 4px;
  padding: 0 8px;
  border: 1px solid var(--line-bright);
  border-radius: 99px;
  color: var(--muted);
  font-size: 9px;
}

.status-pill.ready {
  border-color: rgba(66, 211, 146, .36);
  background: rgba(66, 211, 146, .09);
  color: var(--green);
}

.lesson-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.lesson-heading > p {
  max-width: 760px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.lesson-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.secondary-button,
.complete-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-bright);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
}

.secondary-button svg {
  width: 16px;
  height: 16px;
}

.complete-button {
  border-color: rgba(74, 158, 255, .55);
  background: var(--blue-soft);
}

.complete-button.completed {
  border-color: rgba(66, 211, 146, .45);
  background: rgba(66, 211, 146, .1);
}

.complete-check {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--blue-hi);
}

.complete-button.completed .complete-check {
  border-color: var(--green);
  background: var(--green);
  color: var(--success-ink);
}

.complete-check svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.player-card {
  overflow: visible;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #030507;
  box-shadow: var(--shadow);
}

.video-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    linear-gradient(140deg, rgba(74, 158, 255, .08), transparent 45%),
    #030507;
}

.video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-wrap video::cue {
  color: white;
  background: rgba(2, 5, 9, .82);
  font-size: 88%;
}

.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #030507;
  color: var(--muted);
  font-size: 12px;
  transition: opacity .2s ease;
}

.video-loading.hidden {
  pointer-events: none;
  opacity: 0;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-bright);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.player-toolbar {
  min-height: 66px;
  display: grid;
  grid-template-columns: 1fr minmax(180px, 280px) 1fr;
  align-items: center;
  gap: 22px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface);
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.select-control {
  position: relative;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  padding: 5px 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.language-control {
  min-width: 205px;
}

.voice-control {
  min-width: 220px;
}

/* Two short values, so it does not need the width the name pickers use. */
.quality-control {
  min-width: 96px;
}

.select-control span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.select-control select {
  min-width: 0;
  padding: 0 18px 0 0;
  border: 0;
  outline: 0;
  background: var(--surface-raised);
  color: var(--text);
  color-scheme: inherit;
  font-size: 12px;
  font-weight: 700;
}

.select-control select option {
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 400;
}

.select-control select option:hover,
.select-control select option:focus,
.select-control select option:checked {
  background: var(--blue-soft);
  color: var(--text);
  font-weight: 700;
}

.select-control.enhanced-select select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-trigger {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.custom-select.disabled .custom-select-trigger {
  cursor: wait;
  opacity: .58;
}

.custom-select-trigger strong {
  overflow: hidden;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger svg {
  width: 13px;
  height: 13px;
  color: var(--dim);
  transition: transform .16s ease;
}

.custom-select.open .custom-select-trigger svg {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 120;
  bottom: calc(100% + 12px);
  left: -11px;
  width: max-content;
  min-width: calc(100% + 22px);
  max-width: min(360px, calc(100vw - 32px));
  max-height: min(340px, 52vh);
  overflow-y: auto;
  display: none;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  scrollbar-color: var(--line-bright) transparent;
}

.voice-control .custom-select-menu {
  right: -11px;
  left: auto;
}

.custom-select.open .custom-select-menu {
  display: grid;
}

.custom-select-menu.portaled {
  position: fixed;
  z-index: 300;
  min-width: 0;
  max-width: calc(100vw - 24px);
  display: grid;
}

.custom-select.opens-down .custom-select-menu {
  top: calc(100% + 12px);
  bottom: auto;
}

.custom-select-option {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.custom-select-option::after {
  content: "";
  width: 7px;
  height: 7px;
  justify-self: center;
  border-radius: 50%;
  background: transparent;
}

.custom-select-option:hover,
.custom-select-option:focus-visible,
.custom-select-option.active {
  background: var(--blue-soft);
  color: var(--text);
  font-weight: 700;
}

.custom-select-option[aria-selected="true"] {
  color: var(--blue-hi);
  font-weight: 700;
}

.custom-select-option[aria-selected="true"]::after {
  background: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

.caption-settings {
  position: relative;
  min-width: 174px;
  display: flex;
}

.caption-settings-button {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.caption-settings-button:hover,
.caption-settings-button:focus-visible,
.caption-settings.open .caption-settings-button {
  border-color: var(--line-bright);
  outline: 0;
  background: var(--surface-soft);
}

.caption-cc {
  display: grid;
  place-items: center;
  width: 28px;
  height: 21px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--blue-hi);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
}

.caption-button-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.caption-button-copy small {
  color: var(--dim);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.caption-button-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caption-settings-button > svg {
  width: 13px;
  height: 13px;
  color: var(--dim);
  transition: transform .16s ease;
}

.caption-settings.open .caption-settings-button > svg {
  transform: rotate(180deg);
}

.caption-settings-panel {
  position: absolute;
  z-index: 130;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.caption-settings-panel.opens-down {
  top: calc(100% + 12px);
  bottom: auto;
}

.caption-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.caption-settings-head .eyebrow {
  margin: 0 0 2px;
}

.caption-settings-head h3 {
  margin: 0;
  font-size: 18px;
}

.caption-close-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
}

.caption-close-button:hover,
.caption-close-button:focus-visible {
  border-color: var(--line-bright);
  color: var(--text);
  outline: 0;
}

.caption-close-button svg {
  width: 15px;
  height: 15px;
}

.caption-toggle-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
}

.caption-toggle-row > span {
  display: grid;
  gap: 2px;
}

.caption-toggle-row strong {
  font-size: 12px;
}

.caption-toggle-row small,
.caption-setting-row > small {
  color: var(--dim);
  font-size: 10px;
}

.caption-toggle-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.caption-language-control {
  width: 100%;
  min-width: 0;
  margin-bottom: 14px;
  padding: 7px 10px 8px;
}

.caption-language-control .custom-select-menu {
  right: -11px;
  left: auto;
}

.caption-setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 12px;
  margin-top: 13px;
}

.caption-setting-row label,
.caption-color-control > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.caption-setting-row output {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.caption-setting-row input[type="range"] {
  width: 100%;
  grid-column: 1 / -1;
  accent-color: var(--blue);
}

.caption-setting-row > small {
  grid-column: 1 / -1;
}

.caption-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
}

.caption-color-control {
  display: grid;
  gap: 6px;
}

.caption-color-input {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.caption-color-input input[type="color"] {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.caption-color-input output {
  color: var(--muted);
  font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.caption-preview {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #030507;
  text-align: center;
}

.caption-preview span {
  max-width: 100%;
  padding: 1px 4px;
  font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.25;
}

.caption-reset-button {
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.caption-reset-button:hover,
.caption-reset-button:focus-visible {
  border-color: var(--line-bright);
  color: var(--text);
  outline: 0;
}

.watch-progress {
  display: grid;
  gap: 7px;
}

.watch-progress > span {
  color: var(--muted);
  font: 600 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.shortcut-hint {
  justify-self: end;
  color: var(--dim);
  font-size: 10px;
}

.shortcut-hint kbd + kbd {
  margin-left: 3px;
}

.planned-card {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 250px 1fr;
  align-items: center;
  gap: 45px;
  margin-bottom: 24px;
  padding: 60px clamp(32px, 7vw, 95px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 15% 50%, rgba(74, 158, 255, .12), transparent 18rem),
    var(--planned-bg);
}

.planned-visual {
  position: relative;
  width: 220px;
  height: 220px;
}

.planned-core,
.planned-orbit {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.planned-core {
  width: 20px;
  height: 20px;
  background: var(--magenta);
  box-shadow: 0 0 30px rgba(255, 0, 153, .55);
}

.planned-orbit {
  border: 1px solid rgba(74, 158, 255, .36);
}

.orbit-one {
  width: 125px;
  height: 125px;
}

.orbit-two {
  width: 205px;
  height: 205px;
  border-color: rgba(74, 158, 255, .18);
}

.planned-card h3 {
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -.025em;
}

.planned-card p:not(.eyebrow) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.planned-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.planned-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--meta-bg);
  color: var(--muted);
  font-size: 10px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 20px;
}

.content-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--content-bg);
}

.lesson-guide {
  padding: 25px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card-heading h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.015em;
}

.duration-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
}

.objective-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.objective-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: 13px;
}

.objective-list li::before {
  content: "✓";
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(74, 158, 255, .12);
  color: var(--blue-hi);
  font-size: 10px;
  font-weight: 900;
}

.prerequisite {
  display: grid;
  grid-template-columns: 21px 1fr;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--info-border);
  border-radius: 10px;
  background: rgba(74, 158, 255, .06);
}

.prerequisite > svg {
  width: 20px;
  height: 20px;
  color: var(--blue-hi);
}

.prerequisite strong {
  display: block;
  font-size: 11px;
}

.prerequisite p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.chapter-card {
  overflow: hidden;
}

.tab-list {
  height: 55px;
  display: flex;
  align-items: end;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  position: relative;
  height: 100%;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.detail-tab.active {
  color: var(--text);
}

.detail-tab.active::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: -1px;
  left: 11px;
  height: 2px;
  background: var(--blue);
}

.detail-panel {
  max-height: 340px;
  overflow-y: auto;
  padding: 11px;
  scrollbar-color: var(--line-bright) transparent;
}

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

.chapter-button {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.chapter-button:hover,
.chapter-button.current {
  border-color: var(--line);
  background: var(--surface-raised);
}

.chapter-button.current {
  border-color: var(--accent-border);
}

.chapter-time {
  color: var(--blue-hi);
  font: 650 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

.chapter-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-button svg {
  width: 15px;
  height: 15px;
  color: var(--dim);
}

.transcript-panel {
  padding: 18px 20px;
}

.transcript-entry {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.transcript-entry:last-child {
  border-bottom: 0;
}

.transcript-entry button {
  align-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-hi);
  cursor: pointer;
  font: 650 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: left;
}

.transcript-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 30px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.lesson-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.pagination-button {
  min-width: 0;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}

.pagination-button:hover:not(:disabled) {
  border-color: var(--line-bright);
  background: var(--surface-raised);
}

.pagination-button.next {
  justify-content: flex-end;
  text-align: right;
}

.pagination-button:disabled {
  cursor: default;
  opacity: .35;
}

.pagination-button svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.pagination-button span {
  min-width: 0;
}

.pagination-button small {
  display: block;
  color: var(--dim);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.pagination-button strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.mobile-only {
  display: none;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 15px;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  :root {
    --sidebar-width: 310px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .top-progress {
    display: none;
  }

  .lesson-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .lesson-actions {
    width: 100%;
  }

  .player-toolbar {
    grid-template-columns: 1fr auto;
  }

  .watch-progress {
    min-width: 180px;
  }

  .shortcut-hint {
    display: none;
  }

  .lesson-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  :root {
    --topbar-height: 62px;
  }

  .mobile-only {
    display: grid;
  }

  .desktop-only {
    display: none;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 0 12px;
  }

  .brand-divider,
  .brand-section {
    display: none;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-word {
    font-size: 20px;
  }

  .continue-button {
    padding: 0 11px;
    font-size: 0;
  }

  .continue-button svg {
    width: 19px;
    height: 19px;
  }

  .sidebar {
    z-index: 120;
    top: 0;
    width: min(360px, 88vw);
    transform: translateX(-105%);
    transition: transform .24s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 28px 0 70px rgba(0, 0, 0, .55);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 110;
    inset: 0;
    background: rgba(0, 0, 0, .64);
  }

  .sidebar-head {
    padding-top: 20px;
  }

  .lesson-content {
    margin-left: 0;
    padding: calc(var(--topbar-height) + 27px) 16px 24px;
  }

  .lesson-heading h2 {
    font-size: 34px;
  }

  .lesson-heading > p {
    font-size: 14px;
  }

  .lesson-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .player-card {
    border-radius: 12px;
  }

  .video-wrap {
    border-radius: 12px 12px 0 0;
  }

  .player-toolbar {
    border-radius: 0 0 12px 12px;
  }

  .player-toolbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .toolbar-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .caption-settings {
    grid-column: 1 / -1;
  }

  .caption-settings-panel {
    right: 0;
    left: 0;
    width: 100%;
  }

  .select-control {
    min-width: 0;
  }

  .planned-card {
    min-height: 440px;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 40px 28px;
    text-align: center;
  }

  .planned-visual {
    width: 160px;
    height: 160px;
    margin: auto;
  }

  .orbit-one {
    width: 95px;
    height: 95px;
  }

  .orbit-two {
    width: 155px;
    height: 155px;
  }

  .planned-meta {
    justify-content: center;
  }

  .lesson-pagination {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
