.mg-dialog { width:min(1080px,calc(100% - 24px)); max-height:92vh; padding:0; border:1px solid var(--border); border-radius:12px; color:var(--ink); box-shadow:0 24px 90px #0f2a3340; }
.mg-dialog::backdrop { background:#0f2a3380; }
.mg-dialog [hidden] { display:none!important; }
.mg-top { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 24px; background:var(--teal-light); border-bottom:1px solid var(--border); }
.mg-top h2 { margin:0 0 4px; font-size:20px; }
.mg-top p { margin:0; font-size:14px; }
.mg-body { padding:24px; }
.mg-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom:20px; }
.mg-dialog .btn { min-height:44px; }
.mg-status { padding:12px 16px; border-left:3px solid var(--teal-dark); background:var(--teal-light); margin:0 0 16px; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.mg-status.error { border-color:#a62f2a; background:#fff0ee; color:#8a211d; }
.mg-card { border:1px solid var(--border); border-radius:8px; padding:16px; margin-bottom:12px; }
.mg-card h3 { font-size:16px; margin:0 0 8px; }
.mg-card p { color:#4e626b; line-height:1.5; margin:8px 0; }
.mg-badge { display:inline-block; font-size:12px; background:var(--purple-light); color:var(--purple-dark); padding:4px 8px; border-radius:4px; margin-left:8px; }
.mg-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.mg-fields .wide { grid-column:1/-1; }
.mg-dialog label { display:block; font-size:14px; font-weight:600; margin-bottom:6px; color:var(--ink); text-transform:none; letter-spacing:normal; }
.mg-dialog input:not([type=checkbox]), .mg-dialog textarea, .mg-dialog select { width:100%; max-width:100%; padding:10px 12px; border:1px solid #afbec4; border-radius:6px; font:inherit; line-height:1.5; background:white; color:var(--ink); }
.mg-dialog textarea { resize:vertical; }
.mg-dialog input:focus-visible,.mg-dialog textarea:focus-visible,.mg-dialog button:focus-visible,.mg-dialog summary:focus-visible { outline:3px solid var(--teal-dark); outline-offset:3px; }
.mg-dialog input[type=checkbox] { width:18px; height:18px; flex-shrink:0; margin:2px 0; }
.mg-check { display:flex!important; gap:10px; align-items:flex-start; font-weight:400!important; line-height:1.5; }
.mg-dialog details { border:1px solid var(--border); border-radius:8px; margin:16px 0; padding:16px; }
.mg-dialog summary { cursor:pointer; font-weight:700; font-size:16px; color:var(--purple-dark); min-height:28px; }
.mg-dialog details>.mg-fields { margin-top:16px; }
.mg-help { color:#4e626b; font-size:13px; line-height:1.55; }
.mg-files { padding-left:20px; }
.mg-files li { margin:8px 0; overflow-wrap:anywhere; }
.mg-files button { border:0; background:none; color:var(--teal-dark); text-decoration:underline; text-align:left; cursor:pointer; font:inherit; min-height:32px; }
.mg-footer { display:flex; flex-wrap:wrap; align-items:center; gap:12px; border-top:1px solid var(--border); padding-top:20px; margin-top:20px; }
.mg-dialog :disabled { opacity:.65; cursor:not-allowed; }
.mg-dialog .mg-questions textarea { min-height:80px; }
.mg-reviewed-note { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; line-height:1.7; padding:20px; background:var(--bg); border:1px solid var(--border); border-radius:8px; }
@media(max-width:600px) {
 .mg-top,.mg-body { padding:16px; }
 .mg-fields { grid-template-columns:1fr; }
 .mg-top { align-items:flex-start; }
 .mg-top h2 { font-size:18px; }
 .mg-toolbar .btn,.mg-footer .btn { width:100%; justify-content:center; }
}
