/* Café LUX — shared responsive hardening v1.0
   Applied to every public screen. Page-specific CSS remains authoritative;
   this file only supplies safe viewport/touch/table/modal fallbacks. */
html{box-sizing:border-box;-webkit-text-size-adjust:100%;text-size-adjust:100%;max-width:100%}
*,*::before,*::after{box-sizing:inherit}
body{max-width:100%;overflow-x:hidden}
img,video,canvas,svg{max-width:100%}
button,a,input,select,textarea{touch-action:manipulation}
.lux-table-wrap,.table-wrap,.table-responsive,.table-scroll,.adm-table-wrap,.perm-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Make flex/grid children shrink instead of forcing horizontal overflow. */
main,.main,.main-content,.content,.page,.page-content,.panel,.card,.section,
.shell>*,.layout>*,.app>*,.grid>*,[class*="grid"]>*{min-width:0}

/* Floating widgets must respect notches and the viewport. */
.lux-ai-fabs{right:max(12px,env(safe-area-inset-right))!important}

@media (max-width:1024px){
  .sidebar{max-width:min(86vw,320px)}
  .lux-table,.data-table,.adm-table,.perm-table{width:max-content;min-width:100%}
}

@media (max-width:700px){
  body{min-width:0!important}
  /* iOS/Android browsers zoom fields smaller than 16px. */
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px!important;max-width:100%}
  button,.btn,.btn-sm,.btn-primary,.btn-ghost{min-height:38px}
  .form-grid,.form-row,.grid-2,.grid-3,.two-col,.three-col,.split-grid{grid-template-columns:1fr!important}
  .modal-box,.modal-card,.dialog-card,.sheet-card,.popup-card,.drawer-card,[role="dialog"]{
    max-width:calc(100vw - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
  }
  .lux-table-wrap,.table-wrap,.table-responsive,.table-scroll,.adm-table-wrap,.perm-table-wrap{
    margin-left:0!important;margin-right:0!important;overscroll-behavior-x:contain;
  }
  .lux-ai-fabs{bottom:max(72px,calc(58px + env(safe-area-inset-bottom)))!important}
}

@media (max-width:420px){
  .lux-ai-fabs{transform:scale(.88);transform-origin:bottom right}
}

@media (orientation:landscape) and (max-height:520px){
  .modal-box,.modal-card,.dialog-card,.sheet-card,[role="dialog"]{max-height:calc(100dvh - 8px)!important}
}
