/* Кнопки остаются внутри видимого окна, прокручиваются только согласия. */
#consent-modal {
  top: var(--consent-viewport-top, 0px);
  bottom: auto;
  height: var(--consent-viewport-height, 100vh);
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

@supports (height: 100dvh) {
  #consent-modal {
    height: var(--consent-viewport-height, 100dvh);
  }
}

.consent-dialog-card {
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.consent-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Когда заголовок и кнопки уже не вмещаются, доступна прокрутка всей карточки. */
#consent-modal.consent-dialog-compact {
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#consent-modal.consent-dialog-compact.hidden {
  display: none;
}

#consent-modal.consent-dialog-compact .consent-dialog-card {
  margin-inline: auto;
  max-height: none;
  overflow: visible;
}

#consent-modal.consent-dialog-compact .consent-dialog-body {
  flex: none;
  overflow: visible;
}
