html,
body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-shell {
  height: auto;
  min-height: 100dvh;
  min-height: var(--visual-height, 100dvh);
  overflow: visible;
  overscroll-behavior-y: none;
}

.app-header {
  min-height: 74px;
  padding-top: max(22px, env(safe-area-inset-top));
}

.content-pad {
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.has-bottom-nav {
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
}

.bottom-nav {
  height: calc(76px + env(safe-area-inset-bottom));
  padding: 8px 10px max(9px, env(safe-area-inset-bottom));
}

.bottom-nav a {
  position: relative;
  min-width: 0;
  border-radius: 16px;
  transition: transform .18s ease, color .18s ease, background .18s ease;
}

.bottom-nav a:active { transform: scale(.92); }
.bottom-nav a.active { background: rgba(99, 91, 255, .08); }

.bottom-nav a.active::before {
  position: absolute;
  top: 3px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--kk-primary);
  content: "";
}

button, a, .btn, .store-option {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.network-banner[hidden], .install-prompt[hidden] { display: none !important; }

.network-banner {
  position: fixed;
  z-index: 90;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: calc(100% - 28px);
  max-width: 472px;
  padding: 12px 15px;
  transform: translate(-50%, -150%);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: #242637;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .25);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  transition: transform .28s ease;
}

.network-banner.show { transform: translate(-50%, 0); }
.network-banner i { color: #ffad42; }

.btn.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn.is-loading::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 19px;
  height: 19px;
  margin: -9px;
  border: 2px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: kk-mobile-spin .65s linear infinite;
}

body { overscroll-behavior-y: auto; }
body.is-leaving .app-shell { transform: scale(.995); opacity: .82; }
body > .app-shell { transition: opacity .16s ease, transform .16s ease; }
.content-pad, .pos-page, .receipt-page, .auth-wrap { animation: kk-mobile-page-in .28s ease both; }

@keyframes kk-mobile-page-in {
  from { transform: translateY(7px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes kk-mobile-spin { to { transform: rotate(360deg); } }

@media (max-width: 699px) {
  .form-control, .form-select, textarea { font-size: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
