.dlc-shell {
  --course-page: var(--dl-bg, #faf6fc);
  --course-panel: var(--dl-surface, #ffffff);
  --course-raised: var(--dl-raised, #f4ebf9);
  --course-line: var(--dl-line, #e5d8ed);
  --course-ink: var(--dl-ink, #301d3e);
  --course-muted: var(--dl-muted, #655371);
  --course-accent: var(--dl-link, #632790);
  --course-button: var(--dl-button, #6830a0);
  box-sizing: border-box;
  max-width: 1240px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 32px);
  color: var(--course-ink);
  line-height: 1.75;
}

.dlc-shell *, .dlc-shell *::before, .dlc-shell *::after { box-sizing: inherit; }
.dlc-shell :is(h2, h3, p) { margin: 0; color: inherit; }
.dlc-shell a:focus-visible, .dlc-shell summary:focus-visible, .dlc-shell select:focus-visible {
  outline: 2px solid var(--course-accent);
  outline-offset: 3px;
}

.dlc-panel {
  min-width: 0;
  background: var(--course-panel);
  border: 1px solid var(--course-line);
  border-radius: 18px;
}
.dlc-empty {
  padding: clamp(24px, 6vw, 56px);
  margin-inline: auto;
  max-width: 700px;
}
.dlc-empty p, .dlc-card-content p, .dlc-heading p, .dlc-index > p { color: var(--course-muted); margin-top: 7px; }
.dlc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid var(--course-line);
  color: var(--course-accent);
  background: var(--course-raised);
  text-decoration: none;
  font-weight: 700;
}
.dlc-shell .dlc-primary {
  color: #fff;
  background: var(--course-button);
  border-color: var(--course-button);
}
.dlc-shell .dlc-primary:hover { color: #fff; background: var(--dl-button-hover, #552183); }
.dlc-courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.dlc-course-card { overflow: hidden; display: flex; flex-direction: column; }
.dlc-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--course-raised); }
.dlc-card-content { padding: 16px 20px 20px; }
.dlc-card-content h2 { font-size: clamp(1rem, 2.5vw, 1.35rem); }

.dlc-heading { margin-bottom: 18px; }
.dlc-heading h2 { font-size: clamp(1.25rem, 3vw, 2rem); }
.dlc-back { display: inline-block; color: var(--course-accent); margin-bottom: 6px; text-underline-offset: 3px; }
.dlc-heading code {
  display: inline-block;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--course-raised);
  color: var(--course-accent);
  overflow-wrap: anywhere;
}

.dlc-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr); gap: 16px; align-items: start; }
.dlc-stage { overflow: hidden; }
.dlc-video, .dlc-unavailable {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  min-height: 180px;
  background: #191021;
  color: #f9f0ff;
}
.dlc-video video { display: block; width: 100%; height: 100%; object-fit: contain; }
.dlc-unavailable {
  padding: 20px;
  background: radial-gradient(ellipse at 35% 30%, #41244e 0%, #191021 74%);
  text-align: center;
}
.dlc-watermark {
  position: absolute;
  inset-block-start: 11%;
  inset-inline-end: 5%;
  opacity: .72;
  padding: 2px 6px;
  background: #180d279c;
  color: #fff;
  border-radius: 4px;
  font: .75rem/1.4 sans-serif;
  user-select: none;
  pointer-events: none;
}
.dlc-stage-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  align-items: center;
  padding: 14px 16px;
}
.dlc-stage-caption h3 { flex: 1 1 14ch; font-size: clamp(1rem, 2vw, 1.25rem); overflow-wrap: anywhere; }
.dlc-stage-caption > span, .dlc-speed { color: var(--course-muted); white-space: nowrap; }
.dlc-speed select { width: auto; min-height: 38px; border-radius: 7px; }
.dlc-shell .dlc-playback-error { color: var(--course-accent); background: var(--course-raised); margin: 0 16px 16px; padding: 8px 10px; border-radius: 6px; }

.dlc-index { padding: 13px; max-height: min(72vh, 700px); overflow-y: auto; }
.dlc-index h3 { font-size: 1.02rem; margin: 0 2px 12px; }
.dlc-index details { border-top: 1px solid var(--course-line); }
.dlc-index summary { padding: 8px 3px; cursor: pointer; font-weight: 700; }
.dlc-index summary span { float: inline-end; color: var(--course-muted); font-weight: 400; }
.dlc-index ol { list-style: none; padding: 0; margin: 0 0 8px; }
.dlc-index a {
  display: flex;
  align-items: start;
  justify-content: space-between;
  min-height: 42px;
  gap: 5px 10px;
  padding: 6px 9px;
  margin: 2px 0;
  border-radius: 7px;
  text-decoration: none;
  color: var(--course-ink);
  overflow-wrap: anywhere;
}
.dlc-index a:is(:hover, [aria-current="true"]) { color: var(--course-accent); background: var(--course-raised); }
.dlc-index a[aria-current="true"] { box-shadow: inset -2px 0 var(--course-accent); font-weight: 700; }
.dlc-index a[data-complete="true"] .dlc-duration::after { content: "✓"; margin-inline-start: 5px; color: var(--course-accent); }
.dlc-duration { flex-shrink: 0; color: var(--course-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 740px) {
  .dlc-workspace { grid-template-columns: minmax(0, 1fr); }
  .dlc-index { max-height: none; }
  .dlc-video, .dlc-unavailable { min-height: 0; }
  .dlc-speed { flex-basis: 100%; }
}
