.mj-workbench{--mj-border:#e7e5e4;--mj-panel:#fff;--mj-muted:#78716c;display:grid;grid-template-columns:minmax(300px,390px) minmax(0,1fr);gap:16px;height:100%;overflow:auto;padding:20px;background:#fafaf9;color:#1c1917}
.dark .mj-workbench{--mj-border:#35312f;--mj-panel:#1c1917;--mj-muted:#a8a29e;background:#0c0a09;color:#fafaf9}
.mj-form-panel,.mj-results-panel{border:1px solid var(--mj-border);background:var(--mj-panel);border-radius:12px;padding:22px;min-width:0;overflow:auto}
.mj-heading{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:24px}.mj-heading h1{font-size:24px;font-weight:650}.mj-heading p{font-size:14px;color:var(--mj-muted);margin-top:6px}
.mj-workbench button,.mj-workbench a{cursor:pointer}.mj-workbench button:not(.mj-model button){border:1px solid var(--mj-border);border-radius:8px;padding:8px 12px;font-size:13px;background:transparent;color:inherit}.mj-workbench button:hover:not(:disabled){background:color-mix(in srgb,currentColor 6%,transparent)}.mj-workbench button:disabled{opacity:.5;cursor:not-allowed}
.mj-form-fields{display:grid;gap:18px;border:0;padding:0;margin:0;min-width:0}.mj-form-fields label,.mj-settings label{display:grid;gap:8px;font-size:14px}.mj-model>span{display:block;margin-bottom:8px}.mj-workbench textarea,.mj-workbench input[type=url],.mj-settings select{border:1px solid var(--mj-border,#78716c);border-radius:8px;background:transparent;color:inherit;padding:10px;width:100%;font:inherit;min-width:0}.mj-settings select option{background:var(--mj-panel,#292524);color:inherit}.mj-workbench textarea{resize:vertical;min-height:130px}
.mj-settings{border:0;padding:0;display:grid;gap:14px;min-width:0}.mj-settings .mj-hd{display:flex;align-items:center;gap:10px}.mj-hd input{width:18px;height:18px;accent-color:#a8a29e}.mj-muted{color:var(--mj-muted,#a8a29e);font-size:12px;line-height:1.7;margin:0}.mj-reference{display:grid;gap:12px}.mj-reference-preview img{max-height:200px;object-fit:contain;width:100%}.mj-reference-preview p{font-size:12px;color:var(--mj-muted);overflow-wrap:anywhere}.mj-actions{display:flex;gap:10px}.mj-workbench .mj-submit{width:100%;margin-top:22px;background:#292524!important;color:#fff!important;border:0!important;padding:13px!important;font-size:15px!important}.dark .mj-workbench .mj-submit{background:#e7e5e4!important;color:#1c1917!important}.mj-protocol{margin-top:18px;font-size:11px}
.mj-results-panel h2{font-size:18px;font-weight:600;margin-bottom:18px}.mj-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.mj-result{border:1px solid var(--mj-border);border-radius:10px;overflow:hidden}.mj-result img{width:100%;height:auto;max-height:440px;object-fit:contain}.mj-result-actions{display:flex;align-items:center;gap:12px;padding:12px;font-size:12px}.mj-result-actions>span{flex:1}.mj-result-actions a{color:inherit;text-decoration:underline}.mj-empty{min-height:330px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;color:var(--mj-muted);font-size:15px}.mj-empty small{font-size:12px}.mj-error{border:1px solid #b45309;background:#b4530914;border-radius:8px;padding:16px;font-size:14px;margin-bottom:16px;overflow-wrap:anywhere}.mj-error details{margin-top:12px}.mj-error pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto;font-size:12px;margin-top:10px}.mj-spinner{height:25px;width:25px;border:2px solid var(--mj-border);border-top-color:currentColor;border-radius:50%;animation:mj-spin 1s linear infinite}@keyframes mj-spin{to{transform:rotate(360deg)}}
@media(max-width:1000px){.mj-workbench{grid-template-columns:1fr;height:auto;min-height:100%;padding:12px}.mj-form-panel,.mj-results-panel{padding:18px;overflow:visible}.mj-results{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:540px){.mj-results{grid-template-columns:1fr}.mj-heading{flex-wrap:wrap}}
.mj-grid-preview{margin:16px 0 20px}.mj-grid-preview h3{padding:12px;font-size:15px;font-weight:600}.mj-reference-preview{border:1px solid var(--mj-border);padding:10px;border-radius:8px}
.mj-canvas-results{--mj-border:#e7e5e4;--mj-panel:#fff;--mj-muted:#78716c;position:fixed;bottom:20px;right:20px;z-index:70;width:min(500px,calc(100vw - 40px));max-height:70vh;overflow:auto;border:1px solid var(--mj-border);border-radius:12px;background:var(--mj-panel);color:#1c1917;padding:14px;box-shadow:0 8px 30px #0002}.dark .mj-canvas-results{--mj-border:#35312f;--mj-panel:#1c1917;--mj-muted:#a8a29e;color:#fafaf9}.mj-canvas-results summary{cursor:pointer;font-weight:600}.mj-canvas-results section{margin-top:16px;padding-top:12px;border-top:1px solid var(--mj-border)}.mj-canvas-results h2{font-size:15px;font-weight:600}.mj-canvas-results p{overflow-wrap:anywhere}.mj-canvas-results button{cursor:pointer;border:1px solid var(--mj-border);padding:5px 8px;border-radius:6px;background:transparent}.mj-canvas-results .mj-results{gap:8px}.mj-canvas-results .mj-result-actions{gap:6px;flex-wrap:wrap}.mj-canvas-results .mj-result-actions>span{flex-basis:100%}

.edit-dialog { width:min(1080px,96vw); max-height:92dvh; margin:auto; padding:20px; overflow:auto; border:1px solid #d6d3d1; border-radius:16px; background:var(--background,#fff); color:var(--foreground,#292524); box-shadow:0 20px 80px #0005; }
.edit-dialog::backdrop { background:#1119; }
.edit-dialog header,.edit-round-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.edit-dialog h2 { font-size:20px; font-weight:650; margin:0 0 16px; }
.edit-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; }
.edit-dialog button,.edit-canvas button,.edit-upload,.edit-continue,.edit-history-button { border:1px solid #a8a29e; border-radius:8px; padding:6px 12px; cursor:pointer; font-size:13px; }
.edit-dialog button:disabled,.edit-canvas button:disabled { opacity:.45; cursor:default; }
.edit-continue { width:100%; margin-top:6px; background:#f5f3ff; color:#5b21b6; }
.edit-history-button { position:fixed; right:22px; bottom:16px; z-index:35; background:#292524; color:#fff; box-shadow:0 2px 8px #0003; }
.edit-base { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.edit-base p,.edit-note { font-size:12px; opacity:.7; margin:6px 0; }
.edit-thumb { width:86px; height:86px; object-fit:contain; border:1px solid #d6d3d1; border-radius:8px; display:block; background:#fafaf9; color:#78716c; }
.edit-ref-list { display:flex; gap:10px; flex-wrap:wrap; margin:10px 0; }
.edit-ref-list button { font-size:11px; padding:3px 6px; }
.edit-refs { margin-bottom:16px; }
.edit-upload { display:inline-block; position:relative; overflow:hidden; }
.edit-upload input { position:absolute; inset:0; opacity:0; width:100%; cursor:pointer; }
.edit-dialog textarea { display:block; resize:vertical; min-height:110px; width:100%; padding:10px; border:1px solid #a8a29e; border-radius:8px; background:transparent; margin:8px 0 16px; }
.edit-dialog fieldset { display:grid; gap:12px; margin:12px 0; min-width:0; }
.edit-submit { background:#6d28d9; color:white; width:100%; }
.edit-parameters { display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:12px; }.edit-parameters select { border:1px solid #a8a29e; border-radius:6px; background:transparent; padding:5px; margin-left:5px; }
.edit-error { color:#dc2626; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }
.edit-rounds { max-height:70dvh; overflow:auto; padding-right:6px; }
.edit-rounds article { border:1px solid #d6d3d1; border-radius:10px; padding:12px; margin:12px 0; }
.edit-rounds small { display:block; font-size:11px; opacity:.65; margin:6px 0; overflow-wrap:anywhere; }
.edit-round-title { align-items:start; font-size:13px; }.edit-round-title strong { overflow-wrap:anywhere; }.edit-round-title span { white-space:nowrap; }
.edit-output { display:flex; align-items:center; gap:12px; margin:10px 0; }.edit-output .edit-thumb { width:120px;height:120px; }
.edit-download { display:inline-block; padding-top:5px; font-size:12px; text-decoration:underline; }
.edit-canvas { border-bottom:1px solid #a8a29e55; margin-bottom:8px; padding-bottom:8px; max-height:260px; overflow:auto; font-size:12px; }
.edit-canvas .edit-base { margin-bottom:8px; }.edit-canvas .edit-thumb { width:52px;height:52px; }.edit-canvas .edit-refs { margin-bottom:4px; }
.edit-canvas select { border:1px solid #a8a29e; background:transparent; max-width:100%; margin-left:6px; }
@media(max-width:700px) { .edit-dialog { padding:14px; }.edit-layout { grid-template-columns:1fr; }.edit-rounds { max-height:none; }.edit-history-button { right:12px; bottom:12px; }.edit-dialog .edit-output .edit-thumb { width:90px;height:90px; } }

.image-transfer-progress { display: flex; flex-direction: column; gap: 6px; max-width: 100%; padding: 4px 12px; text-align: center; overflow-wrap: anywhere; }
.image-transfer-progress strong { font-weight: 600; }
.image-transfer-progress small { font-size: 12px; opacity: .8; }
