/* Mobile native scale: keep original app shell, larger touch targets and readable text */
@media (max-width: 900px), (pointer: coarse) {
  html, body, #root {
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html {
    font-size: 20px !important;
  }

  body {
    font-size: 19px !important;
    line-height: 1.55 !important;
    touch-action: pan-x pan-y pinch-zoom;
  }

  main,
  [role="main"] {
    font-size: 19px !important;
  }

  p,
  span,
  div,
  a,
  button,
  label,
  input,
  select,
  textarea,
  li,
  td,
  th {
    font-size: max(17px, 1em) !important;
    line-height: 1.5 !important;
  }

  h1 {
    font-size: clamp(2rem, 8.5vw, 2.85rem) !important;
    line-height: 1.08 !important;
  }

  h2 {
    font-size: clamp(1.55rem, 6.8vw, 2.2rem) !important;
    line-height: 1.14 !important;
  }

  h3 {
    font-size: clamp(1.28rem, 5.8vw, 1.8rem) !important;
    line-height: 1.18 !important;
  }

  [class*="text-xs"],
  [class*="text-[10px]"],
  [class*="text-[11px]"] {
    font-size: 15px !important;
    line-height: 1.35 !important;
  }

  [class*="text-sm"] {
    font-size: 18px !important;
    line-height: 1.45 !important;
  }

  [class*="text-lg"] {
    font-size: 23px !important;
    line-height: 1.25 !important;
  }

  [class*="text-xl"] {
    font-size: 27px !important;
    line-height: 1.16 !important;
  }

  [class*="text-2xl"],
  [class*="text-3xl"],
  [class*="text-4xl"] {
    font-size: 34px !important;
    line-height: 1.08 !important;
  }

  button,
  a,
  input,
  select,
  textarea,
  [role="button"] {
    min-height: 58px !important;
    touch-action: manipulation;
  }

  input,
  select,
  textarea {
    font-size: 18px !important;
    padding-block: 15px !important;
  }

  header button,
  header a,
  [class*="topbar"] button,
  [class*="Topbar"] button,
  [class*="header"] button,
  [class*="Header"] button,
  button[aria-label*="menu" i],
  button[aria-label*="sair" i],
  button[title*="sair" i],
  button[aria-label*="notifica" i] {
    min-width: 60px !important;
    min-height: 60px !important;
  }

  header svg,
  [class*="topbar"] svg,
  [class*="Topbar"] svg,
  [class*="header"] svg,
  [class*="Header"] svg,
  button[aria-label*="menu" i] svg,
  button[aria-label*="sair" i] svg,
  button[title*="sair" i] svg {
    width: 31px !important;
    height: 31px !important;
  }

  header img,
  [class*="topbar"] img,
  [class*="Topbar"] img,
  [class*="header"] img,
  [class*="Header"] img,
  header [class*="avatar" i],
  [class*="topbar"] [class*="avatar" i],
  [class*="Header"] [class*="avatar" i] {
    min-width: 58px !important;
    min-height: 58px !important;
  }

  nav a,
  aside a,
  [role="navigation"] a {
    min-height: 58px !important;
    font-size: 18px !important;
  }

  section,
  article,
  [class*="shadow-sm"],
  [class*="shadow-card"] {
    padding: max(18px, 1rem) !important;
  }
}
