/* Мобильные исправления для всех страниц ЛовиТендера. */
@media (max-width: 920px), (pointer: coarse) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* iOS Safari зумит страницу, если поле меньше 16px. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,
  select {
    font-size: 16px !important;
    line-height: 1.35 !important;
    touch-action: manipulation;
  }

  /* Модалка не должна «прыгать» при открытой клавиатуре. */
  .modal-bg {
    align-items: flex-start !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)) !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 16px !important;
  }

  .modal-body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Чтобы горизонтальный свайп не уводил страницу в историю браузера. */
  body {
    overscroll-behavior-x: none;
  }
}


/* Заглушка, когда свайп назад некуда вести. */
.lt-back-stub {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #263369 0%, #111321 52%, #080a13 100%);
  color: #f6f7ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.lt-back-stub.show { display: flex; }
.lt-back-stub-card {
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  border: 1px solid rgba(174,186,230,.22);
  border-radius: 22px;
  background: rgba(18,23,42,.96);
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
  text-align: center;
}
.lt-back-stub-logo { font-size: 21px; font-weight: 900; letter-spacing: -.5px; }
.lt-back-stub-logo span { color: #7c6bff; }
.lt-back-stub-icon { margin: 22px auto 14px; width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(124,107,255,.14); border: 1px solid rgba(124,107,255,.35); font-size: 30px; }
.lt-back-stub h2 { font-size: 24px; line-height: 1.2; margin: 0 0 10px; }
.lt-back-stub p { margin: 0 auto 20px; max-width: 330px; color: #a3a9c2; font-size: 15px; line-height: 1.5; }
.lt-back-stub-actions { display: flex; flex-direction: column; gap: 10px; }
.lt-back-stub-actions button,
.lt-back-stub-actions a { display: block; width: 100%; box-sizing: border-box; border-radius: 12px; padding: 13px 16px; font: inherit; font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.lt-back-stub-actions button { border: 0; background: linear-gradient(135deg, #7c6bff, #3b82f6); color: #fff; }
.lt-back-stub-actions a { border: 1px solid rgba(174,186,230,.24); background: rgba(255,255,255,.04); color: #dce3ff; }


/* Плашка админа в кабинете клиента. */
#ltImpersonationBar {
  position: fixed;
  left: 0; right: 0; top: 56px;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #1b1830;
  border-bottom: 1px solid #3a3560;
  color: #e9e4ff;
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
#ltImpersonationBar b { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ltImpersonationBar a, #ltImpersonationBar button { color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 5px 9px; text-decoration: none; font: inherit; cursor: pointer; white-space: nowrap; }
@media (max-width: 600px) {
  #ltImpersonationBar { top: 56px; flex-wrap: wrap; gap: 6px; font-size: 12px; }
  #ltImpersonationBar b { flex-basis: 100%; order: 3; }
}


/* Крупные и заметные чекбоксы на мобильных. */
@media (max-width: 920px), (pointer: coarse) {
  input[type="checkbox"], input[type="radio"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    margin: 0 2px 0 0 !important;
    accent-color: #7c6bff;
    vertical-align: middle;
    flex: 0 0 22px;
  }
  .qf-chk, .qf-regions-grid label { min-height: 42px; }
  .qf-chk { padding: 9px 12px; }
  .qf-chk-row { gap: 9px; }
}


@media (max-width: 920px), (pointer: coarse) {
  body.lt-impersonating .layout { padding-top: 46px; }
  body.lt-impersonating .bottom-nav { bottom: 0; }
}
