.mg-card { padding: 28px; }
.mg-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.mg-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; }

/* ===== Dropzone ===== */
.mg-dropzone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 36px 20px; text-align: center; color: #6b7280; cursor: pointer; transition: all .15s ease; }
.mg-dropzone:hover { border-color: var(--site-light); }
.mg-dropzone.dragover { border-color: var(--site-light); background: #f0fdfa; }
.mg-dropzone i { font-size: 2.3em; margin-bottom: 10px; display: block; color: #ca8a04; }
.mg-dropzone p { margin: 0 0 4px; font-weight: 600; color: #374151; }
.mg-dropzone .mg-hint { font-size: .82em; color: #9ca3af; }
.mg-dropzone input[type="file"] { display: none; }

.mg-error { color: var(--site-danger); background: var(--site-danger-bg); border: 1px solid var(--site-danger-border); border-radius: 8px; padding: 12px 16px; font-size: .9em; margin: 16px 0 0; }
.mg-error.hide { display: none; }

/* ===== Workspace ===== */
.mg-workspace { margin-top: 22px; }
.mg-change-file { background: none; border: none; color: var(--site-dark); font-weight: 600; font-size: .88em; cursor: pointer; padding: 0 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.mg-change-file:hover { color: var(--site-dark); }

.mg-workspace-row { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(240px, 320px); gap: 24px; align-items: start; margin-bottom: 20px; }
@media (max-width: 760px) {
    .mg-workspace-row { grid-template-columns: 1fr; }
}

.mg-canvas-wrap { background: repeating-conic-gradient(#f1f3f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border: 1px solid #e5e7eb; border-radius: 10px; min-height: 200px; max-height: 480px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 10px; min-width: 0; }
.mg-canvas-wrap canvas { max-width: 100%; max-height: 460px; object-fit: contain; display: block; border-radius: 4px; }

/* ===== Controls ===== */
.mg-controls { border: 1px solid #eee; border-radius: 10px; padding: 18px 20px; background: #fafbfc; }
.mg-field { margin-bottom: 16px; }
.mg-field:last-child { margin-bottom: 0; }
.mg-field label { display: block; font-size: .85em; font-weight: 600; color: #374151; margin-bottom: 6px; }
.mg-field input[type="text"] {
    width: 100%; border: 1px solid #ddd; border-radius: 7px; padding: 10px 12px; font-size: .95em;
    box-sizing: border-box; background: #fff; color: #23272f; text-transform: uppercase; letter-spacing: .01em;
}
.mg-field input[type="text"]:focus { outline: none; border-color: var(--site-light); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
.mg-field input[type="text"]::placeholder { text-transform: none; color: #9ca3af; }
.mg-field input[type="range"] { width: 100%; accent-color: var(--site-light); }

/* ===== Download button ===== */
.mg-btn { border: none; border-radius: 8px; padding: 13px 26px; font-weight: 700; cursor: pointer; font-size: .98em; display: flex; align-items: center; gap: 8px; background: var(--site-light); color: #fff; width: 100%; justify-content: center; transition: filter .15s ease; }
.mg-btn:disabled { opacity: .45; cursor: not-allowed; }
.mg-btn:not(:disabled):hover { filter: brightness(1.08); }

.mg-status { text-align: center; color: #6b7280; font-size: .88em; margin-top: 12px; min-height: 1.3em; }
.mg-status:empty { display: none; }

@media (max-width: 640px) {
    .mg-canvas-wrap { max-height: 380px; }
    .mg-canvas-wrap canvas { max-height: 360px; }
}
