#mg-wrap{max-width:1100px;margin:0 auto;padding:40px 24px 80px;-webkit-font-smoothing:antialiased}
.mg-layout{display:grid;grid-template-columns:1fr 340px;gap:24px;align-items:start}
.mg-canvas-wrap{position:relative;border-radius:28px;overflow:hidden;box-shadow:0 4px 32px rgba(0,0,0,0.12);background:#f0f0f0;aspect-ratio:16/9;cursor:crosshair}
#mg-canvas{width:100%;height:100%;display:block}
.mg-point{position:absolute;width:22px;height:22px;border-radius:50%;border:2.5px solid rgba(255,255,255,0.9);box-shadow:0 2px 8px rgba(0,0,0,0.3);cursor:grab;transform:translate(-50%,-50%);transition:transform .1s;z-index:10}
.mg-point:active{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2)}
.mg-point.selected{border-color:#fff;box-shadow:0 0 0 3px rgba(255,255,255,0.5),0 2px 8px rgba(0,0,0,0.4)}
.mg-panel{display:flex;flex-direction:column;gap:16px}
.mg-card{background:#fff;border:1px solid #F0F0F0;border-radius:24px;padding:18px;box-shadow:0 1px 3px rgba(0,0,0,0.04)}
.mg-card-title{font-weight:600;text-transform:uppercase;color:#6E6E78;margin-bottom:14px}
.mg-points-list{display:flex;flex-direction:column;gap:8px}
.mg-point-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:14px;border:1.5px solid transparent;cursor:pointer;transition:all .12s}
.mg-point-row:hover{background:#FAFAFA;border-color:#F0F0F0}
.mg-point-row.active{background:#F5F3FF;border-color:#DDD6FE}
.mg-point-swatch{width:32px;height:32px;border-radius:14px;flex-shrink:0;cursor:pointer;border:2px solid rgba(0,0,0,0.08)}
.mg-point-info{flex:1;min-width:0}
.mg-point-label{font-weight:600;color:#333}
.mg-point-hex{font-size:11px;color:#6E6E78;font-family:'SF Mono','Fira Code',monospace}
.mg-point-delete{width:26px;height:26px;border-radius:50%;border:1px solid #F0F0F0;background:#FAFAFA;cursor:pointer;font-size:13px;color: #6E6E78;display:flex;align-items:center;justify-content:center;transition:all .12s;flex-shrink:0}
.mg-point-delete:hover{background:#FEE2E2;border-color:#FCA5A5;color:#DC2626}
.mg-add-point{width:100%;padding:9px;border-radius:14px;border:1.5px dashed #E0E0E0;background:transparent;font-size:13px;font-weight:500;color:#6E6E78;cursor:pointer;transition:all .15s;margin-top:4px}
.mg-add-point:hover{border-color:#111;color:#111;background:#FAFAFA}
.mg-slider-row{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.mg-slider-row:last-child{margin-bottom:0}
.mg-slider-label{display:flex;justify-content:space-between;align-items:center}
.mg-slider-label span{font-size:12px;font-weight:500;color:#555}
.mg-slider-val{font-size:12px;color:#55555F;font-family:'SF Mono','Fira Code',monospace;background:#F5F5F5;padding:2px 7px;border-radius:999px}
input[type=range]{width:100%;height:4px;border-radius:2px;appearance:none;background:#E8E8E8;outline:none;cursor:pointer}
input[type=range]::-webkit-slider-thumb{appearance:none;width:16px;height:16px;border-radius:50%;background:#111;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,0.2)}
.mg-presets{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.mg-preset{height:52px;border-radius:14px;cursor:pointer;border:2px solid transparent;transition:all .15s;position:relative;overflow:hidden}
.mg-preset:hover{transform:scale(1.05);box-shadow:0 4px 12px rgba(0,0,0,0.15)}
.mg-preset.on{border-color:#111;box-shadow:0 0 0 2px #111}
.mg-output{background:#F8F8F8;border:1px solid #F0F0F0;border-radius:20px;padding:14px;position:relative}
.mg-output-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:#6E6E78;margin-bottom:8px}
.mg-output pre{margin:0;font-family:'SF Mono','Fira Code',monospace;white-space:pre-wrap;word-break:break-all;color:#333;max-height:120px;overflow:auto;padding-right:50px}
.mg-copy-btn{position:absolute;top:10px;right:10px;padding:3px 8px;border-radius:999px;border:1px solid #E0E0E0;background:#fff;font-size:11px;font-weight:500;cursor:pointer;transition:all .12s;color:#666}
.mg-copy-btn:hover{background:#111;color:#fff;border-color:#111}
.mg-copy-btn.ok{background:#F0FDF4;border-color:#BBF7D0;color:#166534}
.mg-actions{display:flex;gap:8px;flex-wrap:wrap}
.mg-btn{border-radius:999px;border:none;font-weight:600;cursor:pointer;transition:all .15s}
.mg-btn-primary{background:#111;color:#fff}
.mg-btn-primary:hover{background:#333;transform:translateY(-1px)}
.mg-btn-secondary{background:#F4F4F5;color:#444;border:1px solid #E4E4E7}
.mg-btn-secondary:hover{background:#E4E4E7}
.mg-btn-download{background:#F0F9FF;color:#0369A1;border:1px solid #BAE6FD}
.mg-btn-download:hover{background:#E0F2FE}
.mg-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(80px);background:#111;color:#fff;padding:12px 24px;border-radius:50px;font-size:14px;font-weight:500;transition:transform .3s;z-index:9999;white-space:nowrap;pointer-events:none}
.mg-toast.show{transform:translateX(-50%) translateY(0)}
@media(max-width:768px){.mg-layout{grid-template-columns:1fr}.mg-canvas-wrap{aspect-ratio:4/3}}
