/* The AI preview owns its table sizing; generic CRM tables must not widen it. */
section.modal-window.ai-order-preview {
  width:min(1240px,calc(100vw - 24px)) !important;
  max-width:calc(100vw - 24px) !important;
  min-width:0 !important;
  box-sizing:border-box;
  overflow-x:hidden;
}
.ai-order-preview .ai-group-list {grid-template-columns:minmax(0,1fr) !important;}
.ai-order-preview .ai-group-list article {min-width:0;box-sizing:border-box;}
.ai-order-preview .ai-group-list table {
  width:100% !important;min-width:0 !important;max-width:100%;table-layout:fixed;
}
.ai-order-preview .ai-group-list th,
.ai-order-preview .ai-group-list td {min-width:0 !important;padding:8px 10px !important;box-sizing:border-box;}
.ai-order-preview .ai-group-list th:nth-child(1),
.ai-order-preview .ai-group-list th:nth-child(2) {width:180px;}
.ai-order-preview .ai-group-list th:nth-child(3) {width:140px;}
.ai-order-preview .ai-group-list th:nth-child(4) {width:auto;}
.ai-order-preview .ai-group-list input[data-ai-dimension] {
  width:100% !important;max-width:150px;min-width:0 !important;min-height:36px;
  padding:7px 9px !important;box-sizing:border-box;
}
.ai-order-preview button[data-ai-dimension-delete] {
  min-width:90px;white-space:nowrap;min-height:36px;margin:0;
}
@media(max-width:600px) {
  section.modal-window.ai-order-preview {width:calc(100vw - 12px) !important;max-width:calc(100vw - 12px) !important;}
  .ai-order-preview .ai-group-list th,.ai-order-preview .ai-group-list td {padding:6px 4px !important;font-size:12px;}
  .ai-order-preview .ai-group-list th:nth-child(1),.ai-order-preview .ai-group-list th:nth-child(2) {width:25%;}
  .ai-order-preview .ai-group-list th:nth-child(3) {width:21%;}
  .ai-order-preview .ai-group-list th:nth-child(4) {width:29%;}
  .ai-order-preview button[data-ai-dimension-delete] {min-width:0;width:100%;padding:7px 4px;font-size:12px;}
  .ai-order-preview .ai-preview-summary {grid-template-columns:1fr 1fr;}
}

