.tutorial-hero-with-video .tutorial-hero-copy {
  flex: 1;
  min-width: 0;
}

.tutorial-hero-with-video .tutorial-hero-copy p {
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.tutorial-video { flex: 0 0 52%; min-width: 0; }

.tutorial-video-card {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid #ded6fc;
  border-radius: 13px;
  background: #fff;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 5px 16px #52408f0c;
  transition: box-shadow .18s, border-color .18s;
}

.tutorial-video-card:hover { border-color: #b6a5f6; box-shadow: 0 8px 24px #6650c51c; }
.tutorial-video-card:focus-visible,
.tutorial-video-dialog button:focus-visible { outline: 3px solid #9188ff; outline-offset: 3px; }

.tutorial-video-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: radial-gradient(ellipse at 18% 10%, #817bff 0%, transparent 58%), linear-gradient(135deg, #4538a8, #30266c);
}

.tutorial-video-cover::before,
.tutorial-video-cover::after { content: ''; position: absolute; aspect-ratio: 1; width: 80%; border: 1px solid #ffffff32; border-radius: 50%; }
.tutorial-video-cover::before { left: -24%; bottom: -72%; }
.tutorial-video-cover::after { right: -36%; top: -78%; }

.tutorial-video-play {
  position: absolute;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid #ffffffb3;
  border-radius: 50%;
  color: #fff;
  background: #6246efd9;
  box-shadow: 0 4px 18px #20144540;
}

.tutorial-hero .tutorial-video-play svg { width: 28px; height: 28px; margin-left: 3px; }
.tutorial-video-duration { position: absolute; right: 12px; bottom: 11px; padding: 3px 8px; border-radius: 5px; background: #1e1649cc; color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.tutorial-video-caption { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 16px 18px; }
.tutorial-video-caption strong { font-size: 16px; color: #4b3b84; white-space: nowrap; }
.tutorial-video-caption > span { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #8b7eb0; }
.tutorial-hero .tutorial-video-caption svg { width: 12px; height: 12px; }

dialog.tutorial-video-dialog {
  box-sizing: border-box;
  width: min(1100px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  border: 1px solid #e1ddf1;
  border-radius: 16px;
  color: #302744;
  background: #fff;
  box-shadow: 0 16px 70px #25194430;
}

dialog.tutorial-video-dialog:not([open]) { display: none; }
dialog.tutorial-video-dialog::backdrop { background: #14102488; backdrop-filter: blur(4px); }
.tutorial-video-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.tutorial-video-dialog-heading h2 { margin: 0; font-size: 19px; line-height: 1.5; color: #302744; }
.tutorial-video-dialog-heading p { margin: 5px 0 0; font-size: 12px; line-height: 1.7; color: #8a839c; }
.tutorial-video-dialog-heading form { margin: 0; flex: 0 0 auto; }
.tutorial-video-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #e6e2f2; border-radius: 8px; background: #f8f6ff; color: #77679e; cursor: pointer; }
.tutorial-video-stage { display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #15131e; min-width: 0; }
.tutorial-video-stage video { display: block; width: 100%; height: auto; max-height: calc(100dvh - 164px); aspect-ratio: 16/9; object-fit: contain; background: #15131e; }
.tutorial-video-error { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; margin-top: 16px; border: 1px solid #f3dedf; border-radius: 9px; background: #fff6f6; color: #a46466; font-size: 12px; line-height: 1.7; }
.tutorial-video-error[hidden] { display: none; }
.tutorial-video-error p { margin: 0; }
.tutorial-video-retry { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #dddff0; border-radius: 7px; background: #fff; color: #655bc6; font: inherit; white-space: nowrap; cursor: pointer; }

@media (max-width: 760px) {
  .tutorial-hero-with-video { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; }
  .tutorial-hero-with-video .tutorial-hero-copy p { font-size: 13px; }
  .tutorial-video { grid-column: 1/-1; width: 100%; margin-top: 2px; }
  .tutorial-video-play { width: 60px; height: 60px; }
  .tutorial-video-caption { padding: 12px 14px; }
  .tutorial-video-caption strong { font-size: 14px; }
  .tutorial-video-caption > span { font-size: 12px; }
  dialog.tutorial-video-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 14px; border-radius: 13px; }
  .tutorial-video-dialog-heading { gap: 10px; margin-bottom: 13px; }
  .tutorial-video-dialog-heading h2 { font-size: 17px; }
  .tutorial-video-dialog-heading p { font-size: 11px; }
  .tutorial-video-error { align-items: flex-start; flex-direction: column; }
  .tutorial-video-stage video { max-height: calc(100dvh - 160px); }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-video-card { transition: none; }
}
