.dialog-open {
  overflow: hidden;
}
.detail-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1040px, 94vw);
  max-width: 1040px;
  max-height: 94dvh;
  background: #10151e;
  color: var(--text);
  border: 1px solid #30394a;
  border-radius: 16px;
  padding: 0;
  scrollbar-width: none;
}
.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}
.detail-toolbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: #141b26;
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
}
.detail-toolbar > span {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.7px;
}
.icon-button {
  font-size: 19px;
  color: #aeb9cb;
  width: 39px;
  height: 39px;
  border-radius: 50%;
}
.icon-button:hover {
  background: #293348;
}
.detail-body {
  padding: 22px 28px 20px;
}
.video-frame {
  aspect-ratio: 16/9;
  background: #030406;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 60dvh;
  background: #000;
}
.play-status {
  color: var(--muted);
  font-size: 11px;
  margin: 9px 0;
  min-height: 19px;
}
.play-status.error,
.error {
  color: #edb79f;
}
.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 18px 0 23px;
}
.detail-heading .eyebrow {
  font-size: 10px;
  letter-spacing: 0;
  margin-bottom: 8px;
  color: var(--muted);
}
.detail-heading h1 {
  font-size: 27px;
  line-height: 1.4;
}
.player-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.player-panel {
  background: #19212e;
  border: 1px solid #303b4d;
  border-radius: 9px;
  padding: 18px;
  margin: 0 0 22px;
}
.player-panel h2 {
  font-size: 16px;
  margin-bottom: 13px;
}
.player-panel h2 span {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
  font-weight: 400;
}
.player-panel p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
  max-height: 250px;
  overflow: auto;
}
.episode-grid button,
.speed-options button {
  background: #242e3e;
  border: 1px solid #3a4556;
  border-radius: 6px;
  font-size: 12px;
  min-height: 41px;
  padding: 7px 10px;
}
.episode-grid button.active,
.speed-options button.active,
.source-list button.active {
  background: #2b3d5d;
  border-color: #7b9edc;
  color: #cfdeff;
}
.source-list {
  display: grid;
  gap: 9px;
}
.source-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #242e3e;
  border: 1px solid #3a4556;
  border-radius: 7px;
  padding: 12px;
  text-align: left;
  font-size: 12px;
}
.source-list button span {
  color: var(--muted);
  font-size: 11px;
}
.speed-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.skip-settings {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.skip-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c6d0df;
  font-size: 12px;
}
.skip-settings input {
  width: 67px;
  border: 1px solid #485268;
  padding: 7px;
  background: #101722;
  color: #fff;
  border-radius: 5px;
}
.description {
  font-size: 12px;
  color: #a7b2c4;
  line-height: 1.9;
  margin: 20px 0 8px;
  white-space: pre-line;
}
.credits {
  font-size: 11px;
  color: #6f7e93;
  margin-bottom: 30px;
  line-height: 1.9;
}
.related .poster-rail {
  gap: 16px;
}
.related h2 {
  font-size: 18px;
}
.related .card-meta {
  font-size: 9px;
}
.toast {
  position: fixed;
  z-index: 20;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #465064;
  background: #242e3f;
  color: #eef2ff;
  border-radius: 10px;
  padding: 11px 21px;
  font-size: 12px;
  box-shadow: 0 8px 30px #0008;
  max-width: 85vw;
  text-align: center;
}
@media (max-width: 850px) {
  .detail-dialog {
    width: 96vw;
    max-height: 96dvh;
  }
  .detail-body {
    padding: 18px;
  }
  .related .poster-rail {
    gap: 12px;
  }
}
@media (max-width: 600px) {
  .detail-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    max-width: 100%;
    border: 0;
    border-radius: 0;
  }
  .detail-toolbar {
    height: 53px;
    padding: 0 15px;
  }
  .detail-body {
    padding: 14px 14px 30px;
  }
  .video-frame {
    border-radius: 5px;
  }
  .video-frame video {
    max-height: 65dvh;
  }
  .detail-heading {
    margin: 16px 0 19px;
    align-items: flex-start;
    gap: 10px;
  }
  .detail-heading h1 {
    font-size: 21px;
  }
  .detail-heading .eyebrow {
    font-size: 9px;
    line-height: 1.8;
    max-width: 250px;
  }
  .detail-heading > .button {
    padding: 9px 11px;
    font-size: 10px;
    min-height: 36px;
  }
  .player-actions {
    gap: 7px;
    margin-bottom: 17px;
  }
  .player-actions .button {
    font-size: 11px;
    padding: 9px 11px;
    min-height: 38px;
  }
  .player-panel {
    padding: 14px 12px;
  }
  .player-panel h2 {
    font-size: 14px;
  }
  .source-list button {
    flex-wrap: wrap;
    gap: 5px;
    font-size: 11px;
  }
  .source-list button span:last-child {
    font-size: 10px;
  }
  .episode-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .episode-grid button {
    font-size: 10px;
    padding: 7px 4px;
  }
  .play-status {
    font-size: 10px;
  }
  .description {
    font-size: 11px;
  }
  .credits {
    font-size: 10px;
  }
  .related .poster-rail {
    gap: 12px;
    margin-right: 0;
    padding-right: 0;
  }
  .related h2 {
    font-size: 18px;
  }
  .related .section-heading p {
    font-size: 10px;
  }
  .toast {
    bottom: 92px;
    max-width: 88vw;
    font-size: 11px;
    width: max-content;
  }
  .skip-settings {
    gap: 12px;
  }
  .skip-settings label {
    font-size: 11px;
  }
}
