/* Normal Watch composition uses real template siblings. This bridge keeps the split details visually one desktop card. */
@media (min-width: 641px) {
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    align-items: start;
  }

  /* Override the earlier right-rail `!important` fixed widths only for these grid children.
     Without this reset Bootstrap measures each main child against the grid and can shrink the player. */
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-main,
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-current-panel,
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-secondary-panel,
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .vp_main_watch_page_side {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    float: none !important;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-main {
    grid-column: 1;
    grid-row: 1;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-current-panel {
    grid-column: 1;
    grid-row: 2;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .vp_main_watch_page_side {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-secondary-panel {
    grid-column: 1;
    grid-row: 3;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current-panel > .vp_watch_vid_info.vp_main_watch_page {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-secondary-panel > .vp_watch_vid_info.vp_main_watch_page {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    border-radius: 0 0 22px 22px;
  }
}

/* Mobile Watch drive: real siblings preserve player → current → original rail → secondary without DOM scripts. */
@media (max-width: 640px) {
  body.kb-watch-page .watch_full_cont {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout {
    display: flex;
    flex-direction: column;
    margin-inline: 0;
    min-width: 0;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-main,
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-current-panel,
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-secondary-panel,
  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .vp_main_watch_page_side {
    width: 100%;
    min-width: 0;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-main {
    order: 1;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-current-panel {
    order: 3;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .vp_main_watch_page_side {
    order: 4;
    width: calc(100% - 20px);
    margin: 14px 10px 0;
  }

  body.kb-watch-page .kb-watch-experience > .kb-watch-drive-layout > .kb-watch-drive-secondary-panel {
    order: 5;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current-panel > .vp_watch_vid_info.vp_main_watch_page,
  body.kb-watch-page .kb-watch-experience .kb-watch-drive-secondary-panel > .vp_watch_vid_info.vp_main_watch_page {
    min-width: 0;
    margin: 10px;
    padding: 14px 12px;
    border: 1px solid var(--kb-warm-border);
    border-radius: 16px;
    background: var(--kb-lounge);
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current .video-big-title h1,
  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current .kb-karaoke-tip,
  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current .kb-karaoke-tip > div,
  body.kb-watch-page .kb-watch-experience .kb-watch-drive-secondary {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current .kb-watch-eyebrow {
    margin-bottom: 8px;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current .kb-karaoke-tip {
    margin-bottom: 0;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-secondary .video-options {
    margin-inline: -12px;
    padding-inline: 12px;
  }
}

@media (max-width: 359px) {
  body.kb-watch-page .kb-watch-experience .kb-watch-drive-current-panel > .vp_watch_vid_info.vp_main_watch_page,
  body.kb-watch-page .kb-watch-experience .kb-watch-drive-secondary-panel > .vp_watch_vid_info.vp_main_watch_page {
    margin-inline: 8px;
    padding-inline: 10px;
  }

  body.kb-watch-page .kb-watch-experience .kb-watch-drive-secondary .video-options {
    margin-inline: -10px;
    padding-inline: 10px;
  }
}
