.cpw-guide-topbar {
  position: sticky;
  top: var(--cpw-admin-bar-offset);
  right: 0;
  left: 0;
  z-index: 60;
  border-bottom: 1px solid rgb(0 40 59 / 0.1);
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(12px);
}

.cpw-guide-topbar__inner {
  width: min(100%, 960px);
  min-height: 54px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 32px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cpw-guide-topbar__brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.cpw-guide-topbar__brand .site-header__brand-link {
  display: inline-flex;
  align-items: center;
}

.cpw-guide-topbar__brand .site-header__brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 200px;
}

.cpw-guide-topbar__brand .site-header__brand-logo--white {
  display: none;
}

.cpw-guide-topbar__progress {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.cpw-guide-topbar__dot {
  width: 9px;
  height: 9px;
  margin: 0 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(207 213 219);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.cpw-guide-topbar__dot:hover {
  background: rgb(107 126 139);
}

.cpw-guide-topbar__dot.current {
  background: var(--cpw-color-text-blue);
  transform: scale(1.35);
  box-shadow: 0 0 0 3px rgb(0 114 181 / 0.12);
}

.cpw-guide-topbar__line {
  width: 14px;
  height: 2px;
  background: rgb(207 213 219);
}

.cpw-guide-topbar__pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--cpw-color-text-blue);
  color: var(--cpw-color-white);
  font-family: var(--cpw-font-body);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  border: 0;
  cursor: pointer;
}

.cpw-guide-topbar__pill-icon {
  display: inline-flex;
  align-items: center;
}

.cpw-guide-topbar__pill-icon svg {
  width: 13px;
  height: 13px;
}

body.cpw-guide-video-open {
  overflow: hidden;
}

.cpw-guide__author {
  box-sizing: border-box;
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 0 0 clamp(52px, 7vw, 72px);
}

.cpw-guide__author .cpw-author-box--content-width {
  max-width: 735px;
  margin: 0 0 0 62px;
}

.cpw-guide-video-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cpw-guide-video-modal[hidden],
.cpw-guide-video-modal [hidden] {
  display: none !important;
}

.cpw-guide-video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cpw-guide-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(28 25 23 / 0.75);
  backdrop-filter: blur(4px);
}

.cpw-guide-video-modal__dialog {
  position: relative;
  width: min(100%, 920px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 16px;
  background: #fafbfc;
  box-shadow: 0 2px 6px rgb(27 42 53 / 0.05), 0 24px 60px rgb(27 42 53 / 0.08);
  transform: scale(0.95);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.cpw-guide-video-modal.is-open .cpw-guide-video-modal__dialog {
  transform: none;
}

.cpw-guide-video-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cpw-color-border-subtle);
}

.cpw-guide-video-modal__title {
  margin: 0;
  color: var(--cpw-color-dark-blue);
  font-family: var(--cpw-font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.cpw-guide-video-modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #f4f6f8;
  color: rgb(58 77 89);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cpw-guide-video-modal__close:hover {
  background: var(--cpw-color-dark-blue);
  color: var(--cpw-color-white);
}

.cpw-guide-video-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 0;
  align-items: start;
}

.cpw-guide-video-modal__player-shell {
  min-width: 0;
}

.cpw-guide-video-modal__player {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.cpw-guide-video-modal__player iframe {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cpw-guide-video-modal__poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, #001828, #000c14);
  cursor: pointer;
  overflow: hidden;
}

.cpw-guide-video-modal__poster-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cpw-guide-video-modal__poster-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent, rgb(0 0 0 / 0.4));
}

.cpw-guide-video-modal__poster-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.94);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.cpw-guide-video-modal__poster:hover .cpw-guide-video-modal__poster-play {
  transform: scale(1.1);
  background: #fff;
}

.cpw-guide-video-modal__poster-play svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
  color: var(--cpw-color-dark-blue);
}

.cpw-guide-video-modal__poster-now {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgb(0 0 0 / 0.7), transparent);
  color: var(--cpw-color-white);
  font-size: 12px;
}

.cpw-guide-video-modal__poster-now b {
  font-weight: 600;
}

.cpw-guide-video-modal__poster-time {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  opacity: 0.85;
}

.cpw-guide-video-modal__chapters {
  max-height: 400px;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 12px;
  border-left: 1px solid var(--cpw-color-border-subtle);
}

.cpw-guide-video-modal__chapters-label {
  margin: 0 0 10px;
  padding: 0 4px;
  color: rgb(165 179 189);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cpw-guide-video-modal__chapter-list {
  display: grid;
  gap: 10px;
}

.cpw-guide-video-modal__chapter {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cpw-color-dark-blue);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cpw-guide-video-modal__chapter:hover {
  background: #f4f6f8;
}

.cpw-guide-video-modal__chapter.current {
  background: rgb(0 114 181 / 0.08);
}

.cpw-guide-video-modal__chapter-number {
  width: 16px;
  flex-shrink: 0;
  color: rgb(165 179 189);
  font-family: var(--cpw-font-display);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cpw-guide-video-modal__chapter.current .cpw-guide-video-modal__chapter-number {
  color: var(--cpw-color-text-blue);
}

.cpw-guide-video-modal__chapter-text {
  min-width: 0;
  flex: 1;
}

.cpw-guide-video-modal__chapter-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.cpw-guide-video-modal__chapter-time {
  display: block;
  color: rgb(107 126 139);
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

@media (width <= 760px) {
  .cpw-guide__author {
    padding-inline: 20px;
  }

  .cpw-guide__author .cpw-author-box--content-width {
    max-width: none;
    margin: 0;
  }

  .cpw-guide-topbar__inner {
    gap: 12px;
  }

  .cpw-guide-topbar__dot {
    margin-inline: 4px;
  }

  .cpw-guide-topbar__line {
    width: 8px;
  }

  .cpw-guide-video-modal__header,
  .cpw-guide-video-modal__body {
    padding-inline: 18px;
  }

  .cpw-guide-video-modal {
    padding: 20px;
  }

  .cpw-guide-video-modal__body {
    grid-template-columns: 1fr;
  }

  .cpw-guide-video-modal__chapters {
    max-height: 200px;
    border-left: 0;
    border-top: 1px solid var(--cpw-color-border-subtle);
  }
}

@media (width <= 520px) {
  .cpw-guide-topbar__inner {
    padding-inline: 20px;
  }

  .cpw-guide-topbar__pill span:last-child {
    display: none;
  }

  .cpw-guide-topbar__pill {
    padding-inline: 10px;
  }

  .cpw-guide-video-modal__dialog {
    width: min(100%, 920px);
    max-height: calc(100vh - 24px);
    border-radius: 16px;
  }

  .cpw-guide-video-modal {
    padding: 12px;
  }

  .cpw-guide-video-modal__header {
    padding: 14px 16px;
  }

  .cpw-guide-video-modal__chapters {
    padding: 10px;
  }
}
