/**
 * Mobile app shell — ลด pinch/double-tap zoom และ overscroll ให้รู้สึกใกล้ native app
 */
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overscroll-behavior: none;
}

@media (max-width: 767px) {
  html,
  body,
  #app {
    max-width: 100%;
    overflow-x: hidden;
  }

  .dlish-page-content {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .dlish-page-content h1,
  .dlish-page-content h2,
  .dlish-page-content h3,
  .dlish-page-content p {
    overflow-wrap: anywhere;
  }

  .dlish-page-content .flex:not(.flex-col):not(.flex-nowrap) {
    flex-wrap: wrap;
  }

  .dlish-page-content .inline-flex {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

.dlish-modal-overlay,
.dlish-ai-settings-overlay {
  isolation: isolate;
}
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.dlish-ptr-indicator.is-refreshing .dlish-ptr-icon {
  animation: dlish-ptr-spin 0.85s linear infinite;
}

@keyframes dlish-ptr-spin {
  to {
    transform: rotate(360deg);
  }
}

/* App boot splash — หน้ารอตรวจสอบสิทธิ์ตอนเปิดแอป */
.dlish-offline-banner-enter-active,
.dlish-offline-banner-leave-active {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dlish-offline-banner-enter-from,
.dlish-offline-banner-leave-to {
  transform: translateY(-100%);
  opacity: 0;
}

.dlish-boot-splash {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(165deg, #f8fafc 0%, #fff1f2 42%, #f8fafc 100%);
}

.dlish-boot-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  opacity: 0.55;
  pointer-events: none;
}

.dlish-boot-blob-a {
  top: -8rem;
  left: -6rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.35) 0%, rgba(244, 63, 94, 0) 70%);
  animation: dlish-boot-blob-a 16s ease-in-out infinite;
}

.dlish-boot-blob-b {
  right: -5rem;
  bottom: -4rem;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.4) 0%, rgba(148, 163, 184, 0) 70%);
  animation: dlish-boot-blob-b 20s ease-in-out infinite;
}

.dlish-boot-blob-c {
  top: 38%;
  left: 55%;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(circle, rgba(251, 113, 133, 0.28) 0%, rgba(251, 113, 133, 0) 70%);
  animation: dlish-boot-blob-c 18s ease-in-out infinite;
}

.dlish-boot-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  animation: dlish-boot-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dlish-boot-logo-wrap {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
}

.dlish-boot-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
}

.dlish-boot-ring-outer {
  border: 2px solid transparent;
  border-top-color: rgba(225, 29, 72, 0.85);
  border-right-color: rgba(225, 29, 72, 0.25);
  animation: dlish-boot-spin 1.1s linear infinite;
}

.dlish-boot-ring-inner {
  inset: 0.55rem;
  border: 2px solid transparent;
  border-bottom-color: rgba(100, 116, 139, 0.55);
  border-left-color: rgba(100, 116, 139, 0.15);
  animation: dlish-boot-spin-reverse 1.45s linear infinite;
}

.dlish-boot-logo {
  position: absolute;
  inset: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: dlish-boot-logo-float 3.2s ease-in-out infinite;
  overflow: hidden;
}

.dlish-boot-logo--brand {
  inset: 0.9rem;
  background: transparent;
  box-shadow: none;
}

.dlish-boot-logo-icon {
  font-size: 2rem;
  color: #be123c;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.dlish-boot-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.dlish-boot-app-name {
  margin-top: 1.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #94a3b8;
}

.dlish-boot-message {
  margin-top: 0.45rem;
  font-size: 0.98rem;
  font-weight: 500;
  color: #64748b;
}

.dlish-boot-dots span {
  opacity: 0.25;
  animation: dlish-boot-dot 1.2s ease-in-out infinite;
}

.dlish-boot-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.dlish-boot-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dlish-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dlish-boot-spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes dlish-boot-logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes dlish-boot-fade-up {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dlish-boot-blob-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(14px, -18px) scale(1.06);
  }
}

@keyframes dlish-boot-blob-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-16px, 12px) scale(1.05);
  }
}

@keyframes dlish-boot-blob-c {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(10px, 14px) scale(1.04);
  }
}

@keyframes dlish-boot-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dlish-boot-blob-a,
  .dlish-boot-blob-b,
  .dlish-boot-blob-c,
  .dlish-boot-ring-outer,
  .dlish-boot-ring-inner,
  .dlish-boot-logo,
  .dlish-boot-content,
  .dlish-boot-dots span {
    animation: none !important;
  }
}
