/*
 * Cross-page mobile usability hardening for user-facing templates.
 * Intentionally generic to improve tap targets, text readability,
 * horizontal overflow handling, and safe-area behavior.
 */

html {
  min-height: 100%;
  height: auto;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  height: auto;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

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

main,
section,
article,
aside,
header,
footer,
form,
.ff-container,
.ff-page-wrapper,
.ff-page-header,
.ff-card,
.ff-card-body,
.ff-card-header,
.ff-table-container,
.ff-table-wrapper,
.table-responsive {
  min-width: 0;
  max-width: 100%;
}

.ff-table-container,
.ff-table-wrapper,
.table-responsive,
[class*="table-container"],
[class*="table-wrapper"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

@supports (padding: max(0px)) {
  body {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 1024px) {
  [class*="grid"],
  [class*="filters"],
  [class*="actions"],
  [class*="controls"] {
    min-width: 0;
  }
}

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

  input,
  select,
  textarea,
  button,
  .ff-btn,
  .btn {
    min-height: 44px;
  }

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

  .ff-btn,
  .btn,
  [type="submit"],
  [type="button"] {
    touch-action: manipulation;
  }

  th,
  td {
    vertical-align: middle;
  }

  .ff-card,
  .card,
  [class*="card"] {
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .ff-container,
  .container,
  main {
    padding-left: 0;
    padding-right: 0;
  }

  .ff-btn,
  .btn,
  [type="submit"],
  [type="button"] {
    width: 100%;
  }
}
