.mt-material-detail { width:min(1400px,96vw); max-width:96vw; height:90dvh; max-height:96dvh; padding:0; border:1px solid #bbcbe1; border-radius:6px; background:#fff; color:#172236; box-sizing:border-box; }
.mt-material-detail[open] { display:flex; flex-direction:column; }
.mt-material-detail::backdrop { background:#172a4955; }
.mt-material-detail header { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:linear-gradient(105deg,#29487d,#4168ad); color:white; }
.mt-material-detail header strong { font-size:20px; } .mt-material-detail header button { border:1px solid #ffffff88; border-radius:5px; color:white; background:transparent; font-size:24px; line-height:26px; padding:0 9px; cursor:pointer; }
.mt-material-detail [data-mt-detail-identity] { padding:8px 12px; margin:0; overflow-wrap:anywhere; font-size:13px; }
.mt-detail-tables { min-height:0; flex:1; overflow:auto; padding:0 12px 10px; overscroll-behavior:contain; }
.mt-detail-content { width:100%; }
.mt-detail-content>section,.mt-detail-content>.purchase-order-sheet { margin:0 0 16px; }
.mt-detail-tables h3 { font-size:14px; margin:6px 0; }
.mt-detail-scroll { width:100%; box-sizing:border-box; overflow:auto; border:1px solid var(--st-grid); }
.mt-detail-grid { width:100%; min-width:0; table-layout:fixed; border-collapse:separate; border-spacing:0; font-family:var(--st-font-family); color:var(--st-ink); }
.mt-detail-grid th,.mt-detail-grid td { border-bottom:1px solid var(--st-grid); border-right:1px solid var(--st-grid); text-align:center; box-sizing:border-box; padding:3px 4px; height:var(--st-row-height); font-size:var(--st-body-font); line-height:var(--st-body-line); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.mt-detail-grid th { position:sticky; top:0; z-index:1; background:var(--st-head-bg); color:var(--st-head-ink); height:var(--st-head-height); font-size:var(--st-head-font); line-height:var(--st-head-line); padding:2px; white-space:normal; }
.mt-detail-grid td { cursor:pointer; }
.mt-detail-grid th>span { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.mt-detail-grid td:focus-visible { outline:2px solid #476ebd; outline-offset:-2px; }
.mt-detail-loading,.mt-detail-error { margin:0; padding:40px 12px; font-size:16px; text-align:center; }
.mt-detail-error { color:#ac3527; }
.mt-material-detail footer { display:flex; align-items:center; gap:10px; background:#e4e8ee; border-top:1px solid var(--st-grid); padding:0 10px; min-height:var(--st-footer-height); font-family:var(--st-tab-font-family); }
.mt-material-detail .mt-detail-tab { align-self:stretch; flex:none; background:white; color:var(--st-tab-blue); border:1px solid #aabbce; border-top:3px solid var(--st-tab-green); font-size:var(--st-tab-font); font-weight:bold; padding:4px 16px; }
.mt-material-detail [data-mt-detail-cell] { min-width:0; max-height:80px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
@media(max-width:900px) {
 .mt-detail-material-grid { width:200%; }
}
@media(max-width:600px) {
 .mt-material-detail { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
 .mt-detail-tables { padding:0 8px 8px; }
 .mt-detail-grid td { padding:2px; }
 .mt-material-detail footer { padding-bottom:env(safe-area-inset-bottom); }
}
