/* CS Integrador v1.1.77 - hardening responsive transversal y conservador */
html,body{max-width:100%}
main,section,article,aside,form,fieldset,.container,.panel,.card{min-width:0}
img,svg,video,canvas{max-width:100%;height:auto}
input,select,textarea,button{max-width:100%;box-sizing:border-box}
main h1,main h2,main h3,main h4,main p,main li,main dt,main dd,main label{overflow-wrap:break-word}
.button,button,a.button{white-space:normal;text-align:center;max-width:100%}
.request-action-stack,.document-actions,.stage-action-stack,.stage-payment-actions,.stage-document-actions,.stage-quote-decision,.continuity-actions{display:flex;flex-wrap:wrap;gap:.65rem;min-width:0}

/* Paneles DIAG / IMP / REC */
.stage-workspace-shell,.stage-main,.stage-side,.stage-panel,.stage-project-title,.stage-client-flow,.stage-admin-controls{min-width:0}
.stage-project-head,.stage-route,.stage-page-grid,.stage-project-summary,.stage-form-grid,.stage-upload-grid,.stage-period-columns,.stage-period-head,.stage-repeater-row,.stage-capability-row,.stage-milestone-row,.stage-payment-row,.stage-document-row{min-width:0}
.stage-project-title h1,.stage-panel-head h2,.stage-panel-head h3{line-height:1.12;overflow-wrap:break-word}
.stage-project-meta,.stage-inline-meta{min-width:0}
.stage-route-card,.stage-panel,.stage-financial-card,.stage-period-card{min-width:0}
.stage-route-card strong,.stage-route-card small,.stage-financial-row span,.stage-financial-row strong,.stage-period-head>*{min-width:0;overflow-wrap:break-word}
.stage-capability-row>*,.stage-milestone-row>*,.stage-payment-row>*,.stage-document-row>*{min-width:0}
.stage-payment-actions,.stage-document-actions{justify-content:flex-end}
.stage-repeater-row>*{min-width:0}
.stage-repeater-row input,.stage-repeater-row select,.stage-repeater-row textarea{width:100%;min-width:0}
.stage-repeater-row .button,.stage-repeater-row button{justify-self:end}
.stage-total-bar{align-items:center}
.stage-period-payment{min-width:0}
.stage-period-payment>*{min-width:0}
.stage-document-row strong,.stage-document-row a:not(.button){overflow-wrap:anywhere;word-break:break-word}

/* Continuidad / evolución */
.continuity-request-container,.continuity-request-heading,.continuity-form,.continuity-form-section,.continuity-field-grid,.continuity-choice-grid,.continuity-review,.continuity-client-summary,.continuity-client-action-card{min-width:0}
.continuity-request-heading h1{line-height:1.08;overflow-wrap:break-word}
.continuity-field select,.continuity-field input,.continuity-field textarea{min-width:0;width:100%}
.continuity-choice,.continuity-choice span{min-width:0}

/* Nombres de archivos largos sin afectar navegación */
.document-name,.file-name,.request-document-row strong,.request-document-row a:not(.button){overflow-wrap:anywhere;word-break:break-word;min-width:0}

/* Formularios: impedir que un campo fuerce el ancho de su panel */
.form-grid,.admin-form-grid,.request-form-grid,.quote-form-grid,.filter-grid{min-width:0}
.form-grid>*,.admin-form-grid>*,.request-form-grid>*,.quote-form-grid>*,.filter-grid>*{min-width:0}

/* Tablas: no altera su renderer, solo shells ya diseñados para desplazamiento */
.request-table-shell,.admin-table-scroll,.table-responsive,.table-wrap,.responsive-table{max-width:100%;overflow:auto;overscroll-behavior-inline:contain}
.request-table-shell table,.admin-table-scroll table,.table-responsive table,.table-wrap table,.responsive-table table{width:100%}

/* Laptop / tablet */
@media (max-width:960px){
  .stage-page-grid{grid-template-columns:1fr!important}
  .stage-project-summary{grid-template-columns:1fr!important}
  .stage-project-head{grid-template-columns:1fr!important}
  .stage-route{grid-template-columns:repeat(3,minmax(0,1fr))}
  .stage-project-head>.button,.stage-project-head>.stage-action-stack{justify-self:start}
  .stage-repeater-row{grid-template-columns:minmax(0,1.4fr) minmax(120px,.65fr) minmax(100px,.55fr) auto}
  .continuity-request-heading{gap:18px}
}

/* Móvil */
@media (max-width:760px){
  .stage-workspace-page{padding-top:18px}
  .stage-workspace-page h1,.continuity-request-page h1{font-size:clamp(1.8rem,8vw,2.6rem);line-height:1.05}
  .stage-workspace-page h2,.continuity-request-page h2{font-size:clamp(1.35rem,6vw,1.9rem)}
  .stage-project-head,.stage-panel{padding:17px!important;border-radius:17px!important}
  .stage-route,.stage-form-grid,.stage-upload-grid,.stage-period-columns,.stage-project-summary{grid-template-columns:1fr!important}
  .stage-repeater-row,.stage-repeater-row.milestone{grid-template-columns:1fr!important}
  .stage-repeater-row .button,.stage-repeater-row button{justify-self:stretch;width:100%}
  .stage-capability-row,.stage-milestone-row,.stage-payment-row,.stage-document-row{grid-template-columns:1fr!important;align-items:start!important}
  .stage-payment-actions,.stage-document-actions{justify-content:stretch!important;width:100%}
  .stage-payment-actions>.button,.stage-payment-actions>button,.stage-document-actions>.button,.stage-document-actions>button{flex:1 1 150px}
  .stage-panel-head{flex-direction:column;align-items:stretch!important;gap:10px!important}
  .stage-panel-head>.button,.stage-panel-head>.stage-action-stack{align-self:stretch}
  .stage-total-bar,.stage-financial-row,.stage-period-payment{flex-direction:column!important;align-items:flex-start!important}
  .stage-period-head{grid-template-columns:1fr!important}
  .stage-financial-row strong{text-align:left!important}
  .stage-project-head>.button,.stage-project-summary .stage-panel .button{width:100%!important;justify-content:center}
  .continuity-request-heading,.continuity-review{flex-direction:column!important;align-items:stretch!important}
  .continuity-field-grid,.continuity-choice-grid{grid-template-columns:1fr!important}
  .continuity-form-section{padding:18px!important;border-radius:17px!important}
  .continuity-review .button,.continuity-request-heading>.button{width:100%;justify-content:center}
  .request-action-stack>.button,.request-action-stack>button{flex:1 1 160px}
}

@media (max-width:480px){
  .stage-project-head,.stage-panel,.continuity-form-section{padding:15px!important}
  .stage-route-card{padding:14px!important;min-height:auto!important}
  .stage-action-stack>.button,.stage-action-stack>button,.stage-payment-actions>.button,.stage-payment-actions>button,.stage-document-actions>.button,.stage-document-actions>button{width:100%;flex:1 1 100%}
  .stage-total-bar{gap:8px}
  .continuity-section-head{grid-template-columns:1fr!important;gap:8px!important}
}
