/* Knowptics V1.0.4 mobile usability layer.
   This file only adjusts small-screen interaction and overflow behavior. */

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

pre,
code {
  white-space: pre-wrap;
  word-break: break-word;
}

table {
  max-width: 100%;
}

.kp-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

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

  button,
  a,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  a,
  button {
    min-height: 40px;
  }

  nav.sticky > div,
  nav.bg-white > div {
    height: auto;
    min-height: 4rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  nav img {
    max-height: 2.5rem;
  }

  #welcomeBadge,
  #loginEntry,
  #dashboardEntry {
    max-width: 100%;
    white-space: nowrap;
  }

  main,
  section,
  article,
  footer {
    min-width: 0;
  }

  .shadow-panel {
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
  }

  [class*="rounded-[36px]"],
  [class*="rounded-[40px]"] {
    border-radius: 1.5rem;
  }

  [class*="p-8"],
  [class*="p-9"],
  [class*="p-10"],
  [class*="p-12"] {
    padding: clamp(1.25rem, 5vw, 2rem);
  }

  [class*="py-24"],
  [class*="py-28"] {
    padding-top: clamp(4rem, 14vw, 6rem);
    padding-bottom: clamp(4rem, 14vw, 6rem);
  }

  .kp-scroll-x,
  .prose table,
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .kp-mobile-only {
    display: block;
  }
}

@media (max-width: 430px) {
  body {
    width: 100%;
  }

  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl,
  .max-w-xl,
  .max-w-lg,
  .max-w-md {
    max-width: 100%;
  }

  .grid,
  .flex,
  [class*="grid-cols"],
  [class*="lg:grid"],
  [class*="md:grid"] {
    min-width: 0;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 2.75rem) !important;
    line-height: 1.08 !important;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  h2 {
    max-width: 100%;
    font-size: clamp(1.55rem, 7.4vw, 2.1rem) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere;
  }

  h3,
  p,
  li,
  a,
  span,
  summary,
  details,
  article,
  section,
  div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  [class*="text-4xl"],
  [class*="text-5xl"],
  [class*="text-6xl"],
  [class*="text-7xl"] {
    font-size: clamp(2rem, 10vw, 2.75rem) !important;
    line-height: 1.08 !important;
  }

  [class*="tracking-[0.24em]"],
  [class*="tracking-[0.28em]"],
  [class*="tracking-[0.32em]"] {
    letter-spacing: 0.18em !important;
  }

  .inline-flex,
  button,
  a {
    max-width: 100%;
    white-space: normal;
  }

  [class*="gap-8"],
  [class*="gap-10"],
  [class*="gap-12"] {
    gap: 1.25rem;
  }

  nav .text-sm,
  nav .text-xs {
    line-height: 1.25;
  }

  footer a,
  footer p {
    overflow-wrap: anywhere;
  }
}
