/* Applied only where the isolated preview footer is present. */
body:has(#kl-footer) .koala-popup-quiz {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body:has(#kl-footer) .koala-popup-form-quiz {
  box-sizing: border-box;
  position: relative;
  top: auto !important;
  display: flex !important;
  flex-direction: column;
  min-height: 0 !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  margin: 16px auto !important;
  overflow: hidden !important;
  background: #fff;
}

body:has(#kl-footer) .koala-popup-form-quiz-title,
body:has(#kl-footer) .koala-popup-form-quiz > .nav-tabs {
  flex: 0 0 auto;
}

body:has(#kl-footer) .koala-popup-form-quiz > .tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow: hidden !important;
}

body:has(#kl-footer) .koala-popup-form-quiz > .tab-content > .tab-pane.active {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  padding-bottom: 16px;
  overflow-x: hidden !important;
}

body:has(#kl-footer) .koala-popup-form-quiz .quiz_navigation {
  box-sizing: border-box;
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto;
  width: 100%;
  margin-top: 0 !important;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #ddd;
}

@media (max-height: 600px), (max-width: 700px) {
  body:has(#kl-footer) .koala-popup-form-quiz-title {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  body:has(#kl-footer) .koala-popup-form-quiz .quiz-title {
    font-size: 20px;
    line-height: 1.2;
  }

  body:has(#kl-footer) .koala-popup-form-quiz .quiz-title-desc {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.3;
  }

  body:has(#kl-footer) .koala-popup-form-quiz > .nav-tabs {
    margin-top: 0;
    margin-bottom: 8px;
  }
}