/* Shared responsive rules, loaded after page styles on every full page. */
img, video, iframe { max-inline-size: 100%; }
input, select, textarea { min-inline-size: 0; max-inline-size: 100%; }
.ax-main, .ax-main > *, .card, .profile-panel, .admin-settings__panel,
.data-table, .data-table__filters > *, .grid > *, .support-thread,
.support-message { min-inline-size: 0; }
.ax-main :is(h1, h2, h3, p, dd, strong, .value, .subject),
.support-message a, .tree-list li { overflow-wrap: anywhere; }
.data-table__overflow, .table-wrap { min-inline-size: 0; max-inline-size: 100%; overflow-x: auto; }
.data-table__grid { min-inline-size: 600px; }
.data-table { grid-template-columns: minmax(0, 1fr); }
.data-table__results { min-inline-size: 0; }
.app-menu-backdrop { display: none; }

.pagination-size, .pagination-size label { flex-wrap: wrap; }
.app-dialog { max-inline-size: calc(100vw - 24px); }
.app-dialog__header > :first-child { min-inline-size: 0; overflow-wrap: anywhere; }
.app-dialog__header > button { flex-shrink: 0; }
.ax-header .ax-icon-btn { flex-shrink: 0; }

/* The sidebar reduces the usable width on tablets and smaller laptops. */
@media (max-width: 1200px) {
  .ax-main .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-main .grid { grid-template-columns: minmax(0, 1fr); }
  .data-table__filters, .admin-filters, .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ax-main > :not(.ax-footer) { margin-inline: 12px; inline-size: auto; max-inline-size: calc(100% - 24px); }
  .admin-content > .card, .admin-content > .admin-settings__panel,
  .admin-content > .support-thread, .profile-panel { margin-inline: 12px; }
  .ax-main .stats, .profile-form, .data-table__filters, .admin-filters, .filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero, .card, .profile-panel, .admin-settings__panel,
  .admin-settings__hero { padding: 18px; }
  .profile-form { gap: 18px; }
  .hero-top, .admin-table-heading { flex-wrap: wrap; }
  .ax-header { padding-inline: 8px; gap: 4px; }
  .ax-header .ax-header__spacer { min-inline-size: 0; }
  .ax-header .ax-btn { padding-inline: 8px; font-size: 12px; white-space: normal; }
  .ax-header .ax-icon-btn { inline-size: 36px; block-size: 44px; }
  .app-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .app-dialog__header, .app-dialog__body { padding: 16px; }
  .app-dialog__header { gap: 12px; }
  .app-dialog__header h2 { font-size: 1.1rem; }
  .ax-auth-shell { min-inline-size: 0; }
  .ax-card.ax-auth-surface .ax-card__body, .tpl-auth-register-04 {
    padding: 20px !important;
  }
  .ax-brand-panel { padding: 24px 20px; min-height: auto; }
  .ax-brand-panel .stats-box { grid-template-columns: minmax(0, 1fr); }
  .maintenance-card { padding: 24px 18px; }
  .data-table__pages { justify-content: center; }
  .tpl-dashboard-membership-05 { flex-wrap: wrap; }
  /* Avoid automatic input zoom on iOS and keep controls usable by touch. */
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  select, textarea { font-size: 16px; }
  .data-table__filters button, .data-table__clear, .data-table__action,
  .data-table__pages a, .data-table__current, .pagination-size select,
  .button, .btn, .ax-btn { min-block-size: 44px; }
}

@media (max-width: 767.98px) {
  [data-ax-drawer='open'] .app-menu-backdrop {
    display: block; position: fixed; inset: 0; border: 0;
    background: rgba(0, 0, 0, .45); z-index: var(--ax-z-overlay-backdrop, 900);
  }
}

@media (max-width: 380px) {
  .ax-header .ax-icon-btn { inline-size: 32px; }
  .ax-header .ax-btn { max-inline-size: 100px; font-size: 11px; }
}





/* Short landscape screens must still allow the entire dialog to scroll. */
@media (max-height: 500px) {
  .app-dialog { max-height: calc(100dvh - 16px); }
  .app-dialog__header { padding-block: 10px; }
  .ax-sidebar { overflow-y: auto; }
}
