/* Global mobile foundation for all pages */
html {
  -webkit-text-size-adjust: 100%;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
}

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

input,
select,
textarea,
button {
  font: inherit;
}

/* Common wrappers used throughout the site */
.table-wrap,
.table-scroll,
.scroll-x,
.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  /* Keep frequent flex rows from forcing horizontal overflow */
  .hero-top,
  .hero-left,
  .hero-actions,
  .navbar,
  .navbar-links,
  .header-links,
  .toolbar,
  .filters,
  .actions,
  .tenant-line,
  .analytics-head,
  .analytics-controls {
    min-width: 0;
  }

  /* Force touch-friendly horizontal scrolling for data grids */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Avoid long text tokens causing viewport expansion */
  .tenant-meta,
  .td-subject,
  .td-sub,
  .note,
  .sub,
  .muted {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
