/*
 * Portal Blessed · Capa responsive global
 * Evita que formularios, tarjetas y textos amplíen el panel fuera del viewport.
 */

html,body{
  width:100%;
  max-width:100%;
  min-width:0;
}

html{overflow-x:hidden}
body{overflow-x:clip}

main{
  width:100%;
  min-width:0;
}

main>*,main section,main article,main form,
main .panel,main .product-shell,
main [class*="-grid"],main [class*="-layout"],main [class*="-row"]{
  min-width:0;
  max-width:100%;
}

main [class*="-grid"]>*,
main [class*="-layout"]>*,
main [class*="-row"]>*{
  min-width:0;
}

.panel,.product-shell{
  width:100%;
  min-width:0;
}

.panel.wide{
  width:min(100%,980px);
}

.page-head,.panel-head,.product-head{
  min-width:0;
  max-width:100%;
  flex-wrap:wrap;
}

.page-head>*,.panel-head>*,.product-head>*{
  min-width:0;
}

.form-grid{
  width:100%;
  min-width:0;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.form-grid>*{
  min-width:0;
  max-width:100%;
}

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

label,small,p,strong,span,a{
  overflow-wrap:anywhere;
}

.checkline{
  min-width:0;
  white-space:normal;
}

.permission-check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
  white-space:normal;
}

.permission-check>input{
  flex:0 0 auto;
  margin-top:3px;
}

.permission-check>span{
  display:flex;
  flex:1 1 auto;
  min-width:0;
  flex-direction:column;
  gap:4px;
  line-height:1.35;
}

.permission-check small{
  display:block;
  margin-left:0!important;
  white-space:normal;
  line-height:1.45;
}

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

table{
  width:100%;
  max-width:100%;
}

pre,code{
  max-width:100%;
  overflow-x:auto;
}

.topbar{
  max-width:100%;
  gap:12px;
}

.topbar .brand,.topbar .userbox{
  min-width:0;
}

.topbar .userbox{
  flex-wrap:wrap;
  justify-content:flex-end;
}

@media(max-width:860px){
  main{
    padding-left:18px!important;
    padding-right:18px!important;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .form-grid .span-2{
    grid-column:auto;
  }

  .panel.wide,.panel.narrow{
    width:100%;
    max-width:100%;
  }
}

@media(max-width:700px){
  main{
    padding:20px 14px 56px!important;
  }

  .panel,.product-shell{
    padding-left:17px!important;
    padding-right:17px!important;
  }

  .topbar{
    height:auto;
    min-height:64px;
    padding:10px 14px;
  }

  .page-head>.button,.page-head>form,
  .panel-head>.button,.panel-head>form{
    width:100%;
  }

  button,a.button{
    white-space:normal;
  }
}

@media(max-width:420px){
  main{
    padding-left:12px!important;
    padding-right:12px!important;
  }

  .form-grid{
    gap:12px;
  }

  .panel,.product-shell{
    border-radius:14px!important;
    padding:16px 14px!important;
  }

  .permission-check{
    padding:11px;
  }
}
