/* Khóa scroll nền khi modal mở (mobile + iOS) */
html.dk-scroll-lock,
html.dk-scroll-lock body {
  overflow: hidden !important;
  height: 100%;
}

html.dk-scroll-lock body {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  touch-action: none;
}

.support-modal-overlay.is-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.support-modal-overlay.is-open .support-modal {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* Mobile: chống lệch / tràn ngang */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

#root,
#main,
.row,
.col-8,
#right {
  min-width: 0;
  max-width: 100%;
}

img,
video {
  max-width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  #main {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  #right {
    padding-left: 0 !important;
    padding-right: 0;
    padding-top: 18px;
  }

  #right h1 {
    font-size: 20px;
    line-height: 1.25;
    flex-wrap: wrap;
    gap: 8px;
  }

  #right h1 svg {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
  }

  .support-modal-overlay.is-open {
    padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    align-items: center;
    justify-content: center;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  .support-modal {
    width: 100%;
    max-width: 100%;
    max-height: min(calc(100dvh - 16px), calc(100vh - 16px));
    border-radius: 14px;
    margin: 0 auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .support-modal-header .logo {
    margin-top: 0 !important;
  }

  .support-form input,
  .support-form .iti__tel-input {
    font-size: 16px !important;
  }

  .support-form .iti--separate-dial-code .iti__tel-input,
  .support-form .iti--separate-dial-code input.iti__tel-input,
  .support-form .iti--separate-dial-code #supportPhone {
    padding-left: 78px !important;
  }

  .iti__country-list {
    position: fixed !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .iti--container {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw;
  }

  .resource-item {
    padding: 12px 10px;
    gap: 10px;
  }

  .resource-detail-with-icon {
    padding-left: 12px;
  }
}

/* confirm.html */
body.dk-confirm-page {
  height: auto;
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: clip;
  box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}

body.dk-confirm-page .container {
  padding: 16px 12px;
}

@media (max-width: 767px) {
  body.dk-confirm-page .buttons {
    flex-direction: column;
    gap: 10px;
  }

  body.dk-confirm-page .buttons button {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  body.dk-confirm-page .input-group input {
    font-size: 16px !important;
  }
}