/* 2026-11-23 compatibility patch for existing CRM bundle.
 * Scoped to mobile admin and master screens. UI only. */
@media (max-width: 1279.98px) {
  /* Existing CRM already renders a full AI integration section.
     Its AI workspace overlay adds the canonical second link. Never show both. */
  #admin-mobile-more [data-mobile-sections]:has([data-ai-workspace-nav="mobile"])
  > div.mb-3:has(a[href$="/admin/ai-integrations"]) {
    display: none !important;
  }
  #admin-mobile-more [data-ai-workspace-nav="mobile"] {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
  }
}
@media (max-width: 767.98px) {
  [data-mono-master-shell] {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  [data-mono-master-shell] .master-main,
  [data-mono-master-shell] .master-tenants,
  [data-mono-master-shell] .master-page-head,
  [data-mono-master-shell] .master-page-head__copy,
  [data-mono-master-shell] .master-toolbar,
  [data-mono-master-shell] .master-tenant-grid,
  [data-mono-master-shell] .master-tenant-card,
  [data-mono-master-shell] .master-tenant-card__content,
  [data-mono-master-shell] .master-tenant-card__actions {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  [data-mono-master-shell] .master-tenants {
    padding-inline: max(12px, env(safe-area-inset-left)) !important;
  }
  [data-mono-master-shell] .master-page-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  [data-mono-master-shell] .master-page-head h1 {
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
    max-width: 100%;
  }
  [data-mono-master-shell] .master-page-head__description {
    font-size: 14px !important;
    overflow-wrap: anywhere;
    line-height: 1.55 !important;
  }
  [data-mono-master-shell] .master-page-head__action,
  [data-mono-master-shell] .master-search,
  [data-mono-master-shell] .master-search input {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  [data-mono-master-shell] .master-toolbar {display:flex!important;flex-direction:column!important;}
  [data-mono-master-shell] .master-tenant-grid {display:grid!important;grid-template-columns:minmax(0,1fr)!important;}
  [data-mono-master-shell] .master-tenant-card {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap: 14px !important;
    padding: 16px 12px !important;
  }
  [data-mono-master-shell] .master-tenant-card__heading {
    display:flex;
    flex-wrap:wrap;
    min-width:0;
    gap: 6px;
  }
  [data-mono-master-shell] .master-tenant-card__heading h2,
  [data-mono-master-shell] .master-tenant-card__legal,
  [data-mono-master-shell] .master-tenant-card__stats {
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }
  [data-mono-master-shell] .master-tenant-card__actions {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
  }
  [data-mono-master-shell] .master-tenant-card__actions > .master-button {
    box-sizing:border-box!important;
    display:flex!important;
    justify-content:center!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:44px!important;
    grid-column:1/-1!important;
    font-size:13px!important;
    text-align:center!important;
    overflow-wrap:anywhere;
  }
}
